1 diff --git a/include/ext4_errno.h b/include/ext4_errno.h
2 index edf89a9..a4408c7 100644
3 --- a/include/ext4_errno.h
4 +++ b/include/ext4_errno.h
5 @@ -43,46 +43,74 @@ extern "C" {
6 #include "ext4_config.h"
8 #if !CONFIG_HAVE_OWN_ERRNO
11 -#define EPERM 1 /* Operation not permitted */
12 -#define ENOENT 2 /* No such file or directory */
13 -#define EIO 5 /* I/O error */
14 -#define ENXIO 6 /* No such device or address */
15 -#define E2BIG 7 /* Argument list too long */
16 -#define ENOMEM 12 /* Out of memory */
17 -#define EACCES 13 /* Permission denied */
18 -#define EFAULT 14 /* Bad address */
19 -#define EEXIST 17 /* File exists */
20 -#define ENODEV 19 /* No such device */
21 -#define ENOTDIR 20 /* Not a directory */
22 -#define EISDIR 21 /* Is a directory */
23 -#define EINVAL 22 /* Invalid argument */
24 -#define EFBIG 27 /* File too large */
25 -#define ENOSPC 28 /* No space left on device */
26 -#define EROFS 30 /* Read-only file system */
27 -#define EMLINK 31 /* Too many links */
28 -#define ERANGE 34 /* Math result not representable */
29 -#define ENOTEMPTY 39 /* Directory not empty */
30 -#define ENODATA 61 /* No data available */
31 -#define ENOTSUP 95 /* Not supported */
36 - #define ENODATA ENOATTR
41 + #define LWEXT4_ERRNO(errno) (errno)
45 + #define ENOATTR ENOATTR
63 +#else /* CONFIG_HAVE_OWN_ERRNO */
65 + #define LWEXT4_ERRNO(errno) LWEXT4_##errno
68 + LWEXT4_ERRNO(EOK) = 0,
69 + LWEXT4_ERRNO(EPERM) = 1, /* Operation not permitted */
70 + LWEXT4_ERRNO(ENOENT) = 2, /* No such file or directory */
71 + LWEXT4_ERRNO(ESRCH) = 3, /* No such process */
72 + LWEXT4_ERRNO(EINTR) = 4, /* Interrupted system call */
73 + LWEXT4_ERRNO(EIO) = 5, /* I/O error */
74 + LWEXT4_ERRNO(ENXIO) = 6, /* No such device or address */
75 + LWEXT4_ERRNO(E2BIG) = 7, /* Argument list too long */
76 + LWEXT4_ERRNO(ENOEXEC) = 8, /* Exec format error */
77 + LWEXT4_ERRNO(EBADF) = 9, /* Bad file number */
78 + LWEXT4_ERRNO(ECHILD) = 10, /* No child processes */
79 + LWEXT4_ERRNO(EAGAIN) = 11, /* Try again */
80 + LWEXT4_ERRNO(ENOMEM) = 12, /* Out of memory */
81 + LWEXT4_ERRNO(EACCES) = 13, /* Permission denied */
82 + LWEXT4_ERRNO(EFAULT) = 14, /* Bad address */
83 + LWEXT4_ERRNO(ENOTBLK) = 15, /* Block device required */
84 + LWEXT4_ERRNO(EBUSY) = 16, /* Device or resource busy */
85 + LWEXT4_ERRNO(EEXIST) = 17, /* File exists */
86 + LWEXT4_ERRNO(EXDEV) = 18, /* Cross-device link */
87 + LWEXT4_ERRNO(ENODEV) = 19, /* No such device */
88 + LWEXT4_ERRNO(ENOTDIR) = 20, /* Not a directory */
89 + LWEXT4_ERRNO(EISDIR) = 21, /* Is a directory */
90 + LWEXT4_ERRNO(EINVAL) = 22, /* Invalid argument */
91 + LWEXT4_ERRNO(ENFILE) = 23, /* File table overflow */
92 + LWEXT4_ERRNO(EMFILE) = 24, /* Too many open files */
93 + LWEXT4_ERRNO(ENOTTY) = 25, /* Not a typewriter */
94 + LWEXT4_ERRNO(ETXTBSY) = 26, /* Text file busy */
95 + LWEXT4_ERRNO(EFBIG) = 27, /* File too large */
96 + LWEXT4_ERRNO(ENOSPC) = 28, /* No space left on device */
97 + LWEXT4_ERRNO(ESPIPE) = 29, /* Illegal seek */
98 + LWEXT4_ERRNO(EROFS) = 30, /* Read-only file system */
99 + LWEXT4_ERRNO(EMLINK) = 31, /* Too many links */
100 + LWEXT4_ERRNO(EPIPE) = 32, /* Broken pipe */
101 + LWEXT4_ERRNO(EDOM) = 33, /* Math argument out of domain of func */
102 + LWEXT4_ERRNO(ERANGE) = 34, /* Math result not representable */
103 + LWEXT4_ERRNO(ENOTEMPTY) = 39, /* Directory not empty */
104 + LWEXT4_ERRNO(ENODATA) = 61, /* No data available */
105 + LWEXT4_ERRNO(ENOTSUP) = 95 /* Not supported */
108 +#endif /* CONFIG_HAVE_OWN_ERRNO */