diff options
Diffstat (limited to 'libmount/src/libmount.h.in')
-rw-r--r-- | libmount/src/libmount.h.in | 73 |
1 files changed, 72 insertions, 1 deletions
diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in index 3f2da3230..123145fc4 100644 --- a/libmount/src/libmount.h.in +++ b/libmount/src/libmount.h.in @@ -185,6 +185,72 @@ enum { */ #define MNT_ERR_LOOPOVERLAP 5007 + +/* + * Overall return codes -- based on mount(8) and umount(8) return codes. + * See mnt_context_get_excode() for more details. + */ + +/** + * MNT_EX_SUCCESS: + * + * [u]mount(8) exit code: no errors + */ +#define MNT_EX_SUCCESS 0 + +/** + * MNT_EX_USAGE: + * + * [u]mount(8) exit code: incorrect invocation or permission + */ +#define MNT_EX_USAGE 1 + +/** + * MNT_EX_SYSERR: + * + * [u]mount(8) exit code: out of memory, cannot fork, ... + */ + +#define MNT_EX_SYSERR 2 + +/** + * MNT_EX_SOFTWARE: + * + * [u]mount(8) exit code: internal mount bug or wrong version + */ +#define MNT_EX_SOFTWARE 4 + +/** + * MNT_EX_USER: + * + * [u]mount(8) exit code: user interrupt + */ +#define MNT_EX_USER 8 + +/** + * MNT_EX_FILEIO: + * + * [u]mount(8) exit code: problems writing, locking, ... mtab/fstab + */ +#define MNT_EX_FILEIO 16 + +/** + * MNT_EX_FAIL: + * + * [u]mount(8) exit code: mount failure + */ +#define MNT_EX_FAIL 32 + +/** + * MNT_EX_SOMEOK: + * + * [u]mount(8) exit code: some mount succeeded; usually when executed with + * --all options. Never returned by libmount. + */ +#define MNT_EX_SOMEOK 64 + + + #ifndef __GNUC_PREREQ # if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) @@ -729,7 +795,12 @@ extern int mnt_context_syscall_called(struct libmnt_context *cxt); extern int mnt_context_get_syscall_errno(struct libmnt_context *cxt); extern int mnt_context_strerror(struct libmnt_context *cxt, char *buf, - size_t bufsiz); + size_t bufsiz) + __ul_attribute__((deprecated)); + +extern int mnt_context_get_excode(struct libmnt_context *cxt, + int rc, char *buf, size_t bufsz); + /* context_mount.c */ extern int mnt_context_mount(struct libmnt_context *cxt); |