]> git.ipfire.org Git - thirdparty/util-linux.git/blob - mount/sundries.h
Imported from util-linux-2.11t tarball.
[thirdparty/util-linux.git] / mount / sundries.h
1 /*
2 * sundries.h
3 * Support function prototypes. Functions are in sundries.c.
4 */
5
6 #include <sys/types.h>
7 #include <fcntl.h>
8 #include <limits.h>
9 #include <signal.h>
10 #include <stdarg.h>
11 #include <stdlib.h>
12 #if !defined(bool_t) && !defined(__GLIBC__)
13 #include <rpc/types.h>
14 #endif
15
16 extern int mount_quiet;
17 extern int verbose;
18 extern int sloppy;
19
20 #define streq(s, t) (strcmp ((s), (t)) == 0)
21
22 /* Functions in sundries.c that are used in mount.c and umount.c */
23 void block_signals (int how);
24 char *canonicalize (const char *path);
25 void error (const char *fmt, ...);
26 int matching_type (const char *type, const char *types);
27 void *xmalloc (size_t size);
28 char *xstrdup (const char *s);
29 char *xstrndup (const char *s, int n);
30 char *xstrconcat2 (const char *, const char *);
31 char *xstrconcat3 (const char *, const char *, const char *);
32 char *xstrconcat4 (const char *, const char *, const char *, const char *);
33
34 void die (int errcode, const char *fmt, ...);
35
36 #ifdef HAVE_NFS
37 int nfsmount (const char *spec, const char *node, int *flags,
38 char **orig_opts, char **opt_args, int *version, int running_bg);
39 #endif
40
41 /* exit status - bits below are ORed */
42 #define EX_USAGE 1 /* incorrect invocation or permission */
43 #define EX_SYSERR 2 /* out of memory, cannot fork, ... */
44 #define EX_SOFTWARE 4 /* internal mount bug or wrong version */
45 #define EX_USER 8 /* user interrupt */
46 #define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */
47 #define EX_FAIL 32 /* mount failure */
48 #define EX_SOMEOK 64 /* some mount succeeded */
49
50 #define EX_BG 256 /* retry in background (internal only) */