]>
Commit | Line | Data |
---|---|---|
6dbe3af9 | 1 | /* |
2b6fc908 | 2 | * sundries.h |
6dbe3af9 | 3 | * Support function prototypes. Functions are in sundries.c. |
6dbe3af9 KZ |
4 | */ |
5 | ||
6 | #include <sys/types.h> | |
6dbe3af9 | 7 | #include <fcntl.h> |
6dbe3af9 | 8 | #include <limits.h> |
6dbe3af9 KZ |
9 | #include <signal.h> |
10 | #include <stdarg.h> | |
11 | #include <stdlib.h> | |
2b6fc908 | 12 | #if !defined(bool_t) && !defined(__GLIBC__) |
fd6b7a7f | 13 | #include <rpc/types.h> |
726f69e2 KZ |
14 | #endif |
15 | ||
726f69e2 | 16 | extern int mount_quiet; |
fd6b7a7f | 17 | extern int verbose; |
2b6fc908 | 18 | extern int sloppy; |
6dbe3af9 KZ |
19 | |
20 | #define streq(s, t) (strcmp ((s), (t)) == 0) | |
21 | ||
6dbe3af9 KZ |
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); | |
6dbe3af9 | 25 | void error (const char *fmt, ...); |
364cda48 | 26 | int matching_type (const char *type, const char *types); |
95f1bdee | 27 | int matching_opts (const char *options, const char *test_opts); |
6dbe3af9 KZ |
28 | void *xmalloc (size_t size); |
29 | char *xstrdup (const char *s); | |
fd6b7a7f KZ |
30 | char *xstrndup (const char *s, int n); |
31 | char *xstrconcat2 (const char *, const char *); | |
32 | char *xstrconcat3 (const char *, const char *, const char *); | |
33 | char *xstrconcat4 (const char *, const char *, const char *, const char *); | |
6dbe3af9 | 34 | |
6dbe3af9 | 35 | void die (int errcode, const char *fmt, ...); |
6dbe3af9 KZ |
36 | |
37 | #ifdef HAVE_NFS | |
38 | int nfsmount (const char *spec, const char *node, int *flags, | |
364cda48 | 39 | char **orig_opts, char **opt_args, int *version, int running_bg); |
6dbe3af9 KZ |
40 | #endif |
41 | ||
fd6b7a7f KZ |
42 | /* exit status - bits below are ORed */ |
43 | #define EX_USAGE 1 /* incorrect invocation or permission */ | |
44 | #define EX_SYSERR 2 /* out of memory, cannot fork, ... */ | |
45 | #define EX_SOFTWARE 4 /* internal mount bug or wrong version */ | |
46 | #define EX_USER 8 /* user interrupt */ | |
47 | #define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */ | |
48 | #define EX_FAIL 32 /* mount failure */ | |
49 | #define EX_SOMEOK 64 /* some mount succeeded */ | |
2b6fc908 KZ |
50 | |
51 | #define EX_BG 256 /* retry in background (internal only) */ |