2 * xcommon.h -- Support function prototypes. Functions are in xcommon.c.
4 * 2006-06-06 Amit Gud <agud@redhat.com>
5 * - Moved code snippets from mount/sundries.h of util-linux
6 * and merged code from support/nfs/xmalloc.c by Olaf Kirch <okir@monad.swb.de> here.
12 #include <sys/types.h>
20 #define streq(s, t) (strcmp ((s), (t)) == 0)
22 /* Functions in sundries.c that are used in mount.c and umount.c */
23 char *canonicalize (const char *path);
24 void nfs_error (const char *fmt, ...);
25 void *xmalloc (size_t size);
26 void *xrealloc(void *p, 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 void die (int errcode, const char *fmt, ...);
35 extern void die(int err, const char *fmt, ...);
36 extern void (*at_die)(void);
38 /* exit status - bits below are ORed */
39 #define EX_USAGE 1 /* incorrect invocation or permission */
40 #define EX_SYSERR 2 /* out of memory, cannot fork, ... */
41 #define EX_SOFTWARE 4 /* internal mount bug or wrong version */
42 #define EX_USER 8 /* user interrupt */
43 #define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */
44 #define EX_FAIL 32 /* mount failure */
45 #define EX_SOMEOK 64 /* some mount succeeded */
46 #define EX_BG 256 /* retry in background (internal only) */
48 #endif /* XMALLOC_H */