summaryrefslogtreecommitdiff
path: root/src/errno.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errno.rs')
-rw-r--r--src/errno.rs2580
1 files changed, 1136 insertions, 1444 deletions
diff --git a/src/errno.rs b/src/errno.rs
index 70da6c91..1f88ec78 100644
--- a/src/errno.rs
+++ b/src/errno.rs
@@ -302,7 +302,7 @@ fn desc(errno: Errno) -> &'static str {
EREMCHG => "Remote address changed",
#[cfg(any(target_os = "linux", target_os = "android"))]
- ELIBACC => "Can not acces a needed shared library",
+ ELIBACC => "Can not access a needed shared library",
#[cfg(any(target_os = "linux", target_os = "android"))]
ELIBBAD => "Accessing a corrupted shared library",
@@ -529,143 +529,143 @@ fn desc(errno: Errno) -> &'static str {
mod consts {
use libc;
- #[derive(Debug, Clone, PartialEq, Copy)]
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ #[repr(i32)]
pub enum Errno {
UnknownErrno = 0,
- EPERM = libc::EPERM as isize,
- ENOENT = libc::ENOENT as isize,
- ESRCH = libc::ESRCH as isize,
- EINTR = libc::EINTR as isize,
- EIO = libc::EIO as isize,
- ENXIO = libc::ENXIO as isize,
- E2BIG = libc::E2BIG as isize,
- ENOEXEC = libc::ENOEXEC as isize,
- EBADF = libc::EBADF as isize,
- ECHILD = libc::ECHILD as isize,
- EAGAIN = libc::EAGAIN as isize,
- ENOMEM = libc::ENOMEM as isize,
- EACCES = libc::EACCES as isize,
- EFAULT = libc::EFAULT as isize,
- ENOTBLK = libc::ENOTBLK as isize,
- EBUSY = libc::EBUSY as isize,
- EEXIST = libc::EEXIST as isize,
- EXDEV = libc::EXDEV as isize,
- ENODEV = libc::ENODEV as isize,
- ENOTDIR = libc::ENOTDIR as isize,
- EISDIR = libc::EISDIR as isize,
- EINVAL = libc::EINVAL as isize,
- ENFILE = libc::ENFILE as isize,
- EMFILE = libc::EMFILE as isize,
- ENOTTY = libc::ENOTTY as isize,
- ETXTBSY = libc::ETXTBSY as isize,
- EFBIG = libc::EFBIG as isize,
- ENOSPC = libc::ENOSPC as isize,
- ESPIPE = libc::ESPIPE as isize,
- EROFS = libc::EROFS as isize,
- EMLINK = libc::EMLINK as isize,
- EPIPE = libc::EPIPE as isize,
- EDOM = libc::EDOM as isize,
- ERANGE = libc::ERANGE as isize,
- EDEADLK = libc::EDEADLK as isize,
- ENAMETOOLONG = libc::ENAMETOOLONG as isize,
- ENOLCK = libc::ENOLCK as isize,
- ENOSYS = libc::ENOSYS as isize,
- ENOTEMPTY = libc::ENOTEMPTY as isize,
- ELOOP = libc::ELOOP as isize,
- ENOMSG = libc::ENOMSG as isize,
- EIDRM = libc::EIDRM as isize,
- ECHRNG = libc::ECHRNG as isize,
- EL2NSYNC = libc::EL2NSYNC as isize,
- EL3HLT = libc::EL3HLT as isize,
- EL3RST = libc::EL3RST as isize,
- ELNRNG = libc::ELNRNG as isize,
- EUNATCH = libc::EUNATCH as isize,
- ENOCSI = libc::ENOCSI as isize,
- EL2HLT = libc::EL2HLT as isize,
- EBADE = libc::EBADE as isize,
- EBADR = libc::EBADR as isize,
- EXFULL = libc::EXFULL as isize,
- ENOANO = libc::ENOANO as isize,
- EBADRQC = libc::EBADRQC as isize,
- EBADSLT = libc::EBADSLT as isize,
- EBFONT = libc::EBFONT as isize,
- ENOSTR = libc::ENOSTR as isize,
- ENODATA = libc::ENODATA as isize,
- ETIME = libc::ETIME as isize,
- ENOSR = libc::ENOSR as isize,
- ENONET = libc::ENONET as isize,
- ENOPKG = libc::ENOPKG as isize,
- EREMOTE = libc::EREMOTE as isize,
- ENOLINK = libc::ENOLINK as isize,
- EADV = libc::EADV as isize,
- ESRMNT = libc::ESRMNT as isize,
- ECOMM = libc::ECOMM as isize,
- EPROTO = libc::EPROTO as isize,
- EMULTIHOP = libc::EMULTIHOP as isize,
- EDOTDOT = libc::EDOTDOT as isize,
- EBADMSG = libc::EBADMSG as isize,
- EOVERFLOW = libc::EOVERFLOW as isize,
- ENOTUNIQ = libc::ENOTUNIQ as isize,
- EBADFD = libc::EBADFD as isize,
- EREMCHG = libc::EREMCHG as isize,
- ELIBACC = libc::ELIBACC as isize,
- ELIBBAD = libc::ELIBBAD as isize,
- ELIBSCN = libc::ELIBSCN as isize,
- ELIBMAX = libc::ELIBMAX as isize,
- ELIBEXEC = libc::ELIBEXEC as isize,
- EILSEQ = libc::EILSEQ as isize,
- ERESTART = libc::ERESTART as isize,
- ESTRPIPE = libc::ESTRPIPE as isize,
- EUSERS = libc::EUSERS as isize,
- ENOTSOCK = libc::ENOTSOCK as isize,
- EDESTADDRREQ = libc::EDESTADDRREQ as isize,
- EMSGSIZE = libc::EMSGSIZE as isize,
- EPROTOTYPE = libc::EPROTOTYPE as isize,
- ENOPROTOOPT = libc::ENOPROTOOPT as isize,
- EPROTONOSUPPORT = libc::EPROTONOSUPPORT as isize,
- ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT as isize,
- EOPNOTSUPP = libc::EOPNOTSUPP as isize,
- EPFNOSUPPORT = libc::EPFNOSUPPORT as isize,
- EAFNOSUPPORT = libc::EAFNOSUPPORT as isize,
- EADDRINUSE = libc::EADDRINUSE as isize,
- EADDRNOTAVAIL = libc::EADDRNOTAVAIL as isize,
- ENETDOWN = libc::ENETDOWN as isize,
- ENETUNREACH = libc::ENETUNREACH as isize,
- ENETRESET = libc::ENETRESET as isize,
- ECONNABORTED = libc::ECONNABORTED as isize,
- ECONNRESET = libc::ECONNRESET as isize,
- ENOBUFS = libc::ENOBUFS as isize,
- EISCONN = libc::EISCONN as isize,
- ENOTCONN = libc::ENOTCONN as isize,
- ESHUTDOWN = libc::ESHUTDOWN as isize,
- ETOOMANYREFS = libc::ETOOMANYREFS as isize,
- ETIMEDOUT = libc::ETIMEDOUT as isize,
- ECONNREFUSED = libc::ECONNREFUSED as isize,
- EHOSTDOWN = libc::EHOSTDOWN as isize,
- EHOSTUNREACH = libc::EHOSTUNREACH as isize,
- EALREADY = libc::EALREADY as isize,
- EINPROGRESS = libc::EINPROGRESS as isize,
- ESTALE = libc::ESTALE as isize,
- EUCLEAN = libc::EUCLEAN as isize,
- ENOTNAM = libc::ENOTNAM as isize,
- ENAVAIL = libc::ENAVAIL as isize,
- EISNAM = libc::EISNAM as isize,
- EREMOTEIO = libc::EREMOTEIO as isize,
- EDQUOT = libc::EDQUOT as isize,
- ENOMEDIUM = libc::ENOMEDIUM as isize,
- EMEDIUMTYPE = libc::EMEDIUMTYPE as isize,
- ECANCELED = libc::ECANCELED as isize,
- ENOKEY = libc::ENOKEY as isize,
- EKEYEXPIRED = libc::EKEYEXPIRED as isize,
- EKEYREVOKED = libc::EKEYREVOKED as isize,
- EKEYREJECTED = libc::EKEYREJECTED as isize,
- EOWNERDEAD = libc::EOWNERDEAD as isize,
- ENOTRECOVERABLE = libc::ENOTRECOVERABLE as isize,
-
+ EPERM = libc::EPERM,
+ ENOENT = libc::ENOENT,
+ ESRCH = libc::ESRCH,
+ EINTR = libc::EINTR,
+ EIO = libc::EIO,
+ ENXIO = libc::ENXIO,
+ E2BIG = libc::E2BIG,
+ ENOEXEC = libc::ENOEXEC,
+ EBADF = libc::EBADF,
+ ECHILD = libc::ECHILD,
+ EAGAIN = libc::EAGAIN,
+ ENOMEM = libc::ENOMEM,
+ EACCES = libc::EACCES,
+ EFAULT = libc::EFAULT,
+ ENOTBLK = libc::ENOTBLK,
+ EBUSY = libc::EBUSY,
+ EEXIST = libc::EEXIST,
+ EXDEV = libc::EXDEV,
+ ENODEV = libc::ENODEV,
+ ENOTDIR = libc::ENOTDIR,
+ EISDIR = libc::EISDIR,
+ EINVAL = libc::EINVAL,
+ ENFILE = libc::ENFILE,
+ EMFILE = libc::EMFILE,
+ ENOTTY = libc::ENOTTY,
+ ETXTBSY = libc::ETXTBSY,
+ EFBIG = libc::EFBIG,
+ ENOSPC = libc::ENOSPC,
+ ESPIPE = libc::ESPIPE,
+ EROFS = libc::EROFS,
+ EMLINK = libc::EMLINK,
+ EPIPE = libc::EPIPE,
+ EDOM = libc::EDOM,
+ ERANGE = libc::ERANGE,
+ EDEADLK = libc::EDEADLK,
+ ENAMETOOLONG = libc::ENAMETOOLONG,
+ ENOLCK = libc::ENOLCK,
+ ENOSYS = libc::ENOSYS,
+ ENOTEMPTY = libc::ENOTEMPTY,
+ ELOOP = libc::ELOOP,
+ ENOMSG = libc::ENOMSG,
+ EIDRM = libc::EIDRM,
+ ECHRNG = libc::ECHRNG,
+ EL2NSYNC = libc::EL2NSYNC,
+ EL3HLT = libc::EL3HLT,
+ EL3RST = libc::EL3RST,
+ ELNRNG = libc::ELNRNG,
+ EUNATCH = libc::EUNATCH,
+ ENOCSI = libc::ENOCSI,
+ EL2HLT = libc::EL2HLT,
+ EBADE = libc::EBADE,
+ EBADR = libc::EBADR,
+ EXFULL = libc::EXFULL,
+ ENOANO = libc::ENOANO,
+ EBADRQC = libc::EBADRQC,
+ EBADSLT = libc::EBADSLT,
+ EBFONT = libc::EBFONT,
+ ENOSTR = libc::ENOSTR,
+ ENODATA = libc::ENODATA,
+ ETIME = libc::ETIME,
+ ENOSR = libc::ENOSR,
+ ENONET = libc::ENONET,
+ ENOPKG = libc::ENOPKG,
+ EREMOTE = libc::EREMOTE,
+ ENOLINK = libc::ENOLINK,
+ EADV = libc::EADV,
+ ESRMNT = libc::ESRMNT,
+ ECOMM = libc::ECOMM,
+ EPROTO = libc::EPROTO,
+ EMULTIHOP = libc::EMULTIHOP,
+ EDOTDOT = libc::EDOTDOT,
+ EBADMSG = libc::EBADMSG,
+ EOVERFLOW = libc::EOVERFLOW,
+ ENOTUNIQ = libc::ENOTUNIQ,
+ EBADFD = libc::EBADFD,
+ EREMCHG = libc::EREMCHG,
+ ELIBACC = libc::ELIBACC,
+ ELIBBAD = libc::ELIBBAD,
+ ELIBSCN = libc::ELIBSCN,
+ ELIBMAX = libc::ELIBMAX,
+ ELIBEXEC = libc::ELIBEXEC,
+ EILSEQ = libc::EILSEQ,
+ ERESTART = libc::ERESTART,
+ ESTRPIPE = libc::ESTRPIPE,
+ EUSERS = libc::EUSERS,
+ ENOTSOCK = libc::ENOTSOCK,
+ EDESTADDRREQ = libc::EDESTADDRREQ,
+ EMSGSIZE = libc::EMSGSIZE,
+ EPROTOTYPE = libc::EPROTOTYPE,
+ ENOPROTOOPT = libc::ENOPROTOOPT,
+ EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
+ ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT,
+ EOPNOTSUPP = libc::EOPNOTSUPP,
+ EPFNOSUPPORT = libc::EPFNOSUPPORT,
+ EAFNOSUPPORT = libc::EAFNOSUPPORT,
+ EADDRINUSE = libc::EADDRINUSE,
+ EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
+ ENETDOWN = libc::ENETDOWN,
+ ENETUNREACH = libc::ENETUNREACH,
+ ENETRESET = libc::ENETRESET,
+ ECONNABORTED = libc::ECONNABORTED,
+ ECONNRESET = libc::ECONNRESET,
+ ENOBUFS = libc::ENOBUFS,
+ EISCONN = libc::EISCONN,
+ ENOTCONN = libc::ENOTCONN,
+ ESHUTDOWN = libc::ESHUTDOWN,
+ ETOOMANYREFS = libc::ETOOMANYREFS,
+ ETIMEDOUT = libc::ETIMEDOUT,
+ ECONNREFUSED = libc::ECONNREFUSED,
+ EHOSTDOWN = libc::EHOSTDOWN,
+ EHOSTUNREACH = libc::EHOSTUNREACH,
+ EALREADY = libc::EALREADY,
+ EINPROGRESS = libc::EINPROGRESS,
+ ESTALE = libc::ESTALE,
+ EUCLEAN = libc::EUCLEAN,
+ ENOTNAM = libc::ENOTNAM,
+ ENAVAIL = libc::ENAVAIL,
+ EISNAM = libc::EISNAM,
+ EREMOTEIO = libc::EREMOTEIO,
+ EDQUOT = libc::EDQUOT,
+ ENOMEDIUM = libc::ENOMEDIUM,
+ EMEDIUMTYPE = libc::EMEDIUMTYPE,
+ ECANCELED = libc::ECANCELED,
+ ENOKEY = libc::ENOKEY,
+ EKEYEXPIRED = libc::EKEYEXPIRED,
+ EKEYREVOKED = libc::EKEYREVOKED,
+ EKEYREJECTED = libc::EKEYREJECTED,
+ EOWNERDEAD = libc::EOWNERDEAD,
+ ENOTRECOVERABLE = libc::ENOTRECOVERABLE,
#[cfg(not(any(target_os = "android", target_arch="mips")))]
- ERFKILL = libc::ERFKILL as isize,
+ ERFKILL = libc::ERFKILL,
#[cfg(not(any(target_os = "android", target_arch="mips")))]
- EHWPOISON = libc::EHWPOISON as isize,
+ EHWPOISON = libc::EHWPOISON,
}
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
@@ -675,7 +675,7 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
+ 0 => UnknownErrno,
libc::EPERM => EPERM,
libc::ENOENT => ENOENT,
libc::ESRCH => ESRCH,
@@ -805,7 +805,6 @@ mod consts {
libc::EKEYREJECTED => EKEYREJECTED,
libc::EOWNERDEAD => EOWNERDEAD,
libc::ENOTRECOVERABLE => ENOTRECOVERABLE,
-
#[cfg(not(any(target_os = "android", target_arch="mips")))]
libc::ERFKILL => ERFKILL,
#[cfg(not(any(target_os = "android", target_arch="mips")))]
@@ -817,115 +816,118 @@ mod consts {
#[cfg(any(target_os = "macos", target_os = "ios"))]
mod consts {
- #[derive(Copy, Debug, Clone, PartialEq)]
+ use libc;
+
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ #[repr(i32)]
pub enum Errno {
UnknownErrno = 0,
- EPERM = 1,
- ENOENT = 2,
- ESRCH = 3,
- EINTR = 4,
- EIO = 5,
- ENXIO = 6,
- E2BIG = 7,
- ENOEXEC = 8,
- EBADF = 9,
- ECHILD = 10,
- EDEADLK = 11,
- ENOMEM = 12,
- EACCES = 13,
- EFAULT = 14,
- ENOTBLK = 15,
- EBUSY = 16,
- EEXIST = 17,
- EXDEV = 18,
- ENODEV = 19,
- ENOTDIR = 20,
- EISDIR = 21,
- EINVAL = 22,
- ENFILE = 23,
- EMFILE = 24,
- ENOTTY = 25,
- ETXTBSY = 26,
- EFBIG = 27,
- ENOSPC = 28,
- ESPIPE = 29,
- EROFS = 30,
- EMLINK = 31,
- EPIPE = 32,
- EDOM = 33,
- ERANGE = 34,
- EAGAIN = 35,
- EINPROGRESS = 36,
- EALREADY = 37,
- ENOTSOCK = 38,
- EDESTADDRREQ = 39,
- EMSGSIZE = 40,
- EPROTOTYPE = 41,
- ENOPROTOOPT = 42,
- EPROTONOSUPPORT = 43,
- ESOCKTNOSUPPORT = 44,
- ENOTSUP = 45,
- EPFNOSUPPORT = 46,
- EAFNOSUPPORT = 47,
- EADDRINUSE = 48,
- EADDRNOTAVAIL = 49,
- ENETDOWN = 50,
- ENETUNREACH = 51,
- ENETRESET = 52,
- ECONNABORTED = 53,
- ECONNRESET = 54,
- ENOBUFS = 55,
- EISCONN = 56,
- ENOTCONN = 57,
- ESHUTDOWN = 58,
- ETOOMANYREFS = 59,
- ETIMEDOUT = 60,
- ECONNREFUSED = 61,
- ELOOP = 62,
- ENAMETOOLONG = 63,
- EHOSTDOWN = 64,
- EHOSTUNREACH = 65,
- ENOTEMPTY = 66,
- EPROCLIM = 67,
- EUSERS = 68,
- EDQUOT = 69,
- ESTALE = 70,
- EREMOTE = 71,
- EBADRPC = 72,
- ERPCMISMATCH = 73,
- EPROGUNAVAIL = 74,
- EPROGMISMATCH = 75,
- EPROCUNAVAIL = 76,
- ENOLCK = 77,
- ENOSYS = 78,
- EFTYPE = 79,
- EAUTH = 80,
- ENEEDAUTH = 81,
- EPWROFF = 82,
- EDEVERR = 83,
- EOVERFLOW = 84,
- EBADEXEC = 85,
- EBADARCH = 86,
- ESHLIBVERS = 87,
- EBADMACHO = 88,
- ECANCELED = 89,
- EIDRM = 90,
- ENOMSG = 91,
- EILSEQ = 92,
- ENOATTR = 93,
- EBADMSG = 94,
- EMULTIHOP = 95,
- ENODATA = 96,
- ENOLINK = 97,
- ENOSR = 98,
- ENOSTR = 99,
- EPROTO = 100,
- ETIME = 101,
- EOPNOTSUPP = 102,
- ENOPOLICY = 103,
- ENOTRECOVERABLE = 104,
- EOWNERDEAD = 105,
- EQFULL = 106,
+ EPERM = libc::EPERM,
+ ENOENT = libc::ENOENT,
+ ESRCH = libc::ESRCH,
+ EINTR = libc::EINTR,
+ EIO = libc::EIO,
+ ENXIO = libc::ENXIO,
+ E2BIG = libc::E2BIG,
+ ENOEXEC = libc::ENOEXEC,
+ EBADF = libc::EBADF,
+ ECHILD = libc::ECHILD,
+ EDEADLK = libc::EDEADLK,
+ ENOMEM = libc::ENOMEM,
+ EACCES = libc::EACCES,
+ EFAULT = libc::EFAULT,
+ ENOTBLK = libc::ENOTBLK,
+ EBUSY = libc::EBUSY,
+ EEXIST = libc::EEXIST,
+ EXDEV = libc::EXDEV,
+ ENODEV = libc::ENODEV,
+ ENOTDIR = libc::ENOTDIR,
+ EISDIR = libc::EISDIR,
+ EINVAL = libc::EINVAL,
+ ENFILE = libc::ENFILE,
+ EMFILE = libc::EMFILE,
+ ENOTTY = libc::ENOTTY,
+ ETXTBSY = libc::ETXTBSY,
+ EFBIG = libc::EFBIG,
+ ENOSPC = libc::ENOSPC,
+ ESPIPE = libc::ESPIPE,
+ EROFS = libc::EROFS,
+ EMLINK = libc::EMLINK,
+ EPIPE = libc::EPIPE,
+ EDOM = libc::EDOM,
+ ERANGE = libc::ERANGE,
+ EAGAIN = libc::EAGAIN,
+ EINPROGRESS = libc::EINPROGRESS,
+ EALREADY = libc::EALREADY,
+ ENOTSOCK = libc::ENOTSOCK,
+ EDESTADDRREQ = libc::EDESTADDRREQ,
+ EMSGSIZE = libc::EMSGSIZE,
+ EPROTOTYPE = libc::EPROTOTYPE,
+ ENOPROTOOPT = libc::ENOPROTOOPT,
+ EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
+ ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT,
+ ENOTSUP = libc::ENOTSUP,
+ EPFNOSUPPORT = libc::EPFNOSUPPORT,
+ EAFNOSUPPORT = libc::EAFNOSUPPORT,
+ EADDRINUSE = libc::EADDRINUSE,
+ EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
+ ENETDOWN = libc::ENETDOWN,
+ ENETUNREACH = libc::ENETUNREACH,
+ ENETRESET = libc::ENETRESET,
+ ECONNABORTED = libc::ECONNABORTED,
+ ECONNRESET = libc::ECONNRESET,
+ ENOBUFS = libc::ENOBUFS,
+ EISCONN = libc::EISCONN,
+ ENOTCONN = libc::ENOTCONN,
+ ESHUTDOWN = libc::ESHUTDOWN,
+ ETOOMANYREFS = libc::ETOOMANYREFS,
+ ETIMEDOUT = libc::ETIMEDOUT,
+ ECONNREFUSED = libc::ECONNREFUSED,
+ ELOOP = libc::ELOOP,
+ ENAMETOOLONG = libc::ENAMETOOLONG,
+ EHOSTDOWN = libc::EHOSTDOWN,
+ EHOSTUNREACH = libc::EHOSTUNREACH,
+ ENOTEMPTY = libc::ENOTEMPTY,
+ EPROCLIM = libc::EPROCLIM,
+ EUSERS = libc::EUSERS,
+ EDQUOT = libc::EDQUOT,
+ ESTALE = libc::ESTALE,
+ EREMOTE = libc::EREMOTE,
+ EBADRPC = libc::EBADRPC,
+ ERPCMISMATCH = libc::ERPCMISMATCH,
+ EPROGUNAVAIL = libc::EPROGUNAVAIL,
+ EPROGMISMATCH = libc::EPROGMISMATCH,
+ EPROCUNAVAIL = libc::EPROCUNAVAIL,
+ ENOLCK = libc::ENOLCK,
+ ENOSYS = libc::ENOSYS,
+ EFTYPE = libc::EFTYPE,
+ EAUTH = libc::EAUTH,
+ ENEEDAUTH = libc::ENEEDAUTH,
+ EPWROFF = libc::EPWROFF,
+ EDEVERR = libc::EDEVERR,
+ EOVERFLOW = libc::EOVERFLOW,
+ EBADEXEC = libc::EBADEXEC,
+ EBADARCH = libc::EBADARCH,
+ ESHLIBVERS = libc::ESHLIBVERS,
+ EBADMACHO = libc::EBADMACHO,
+ ECANCELED = libc::ECANCELED,
+ EIDRM = libc::EIDRM,
+ ENOMSG = libc::ENOMSG,
+ EILSEQ = libc::EILSEQ,
+ ENOATTR = libc::ENOATTR,
+ EBADMSG = libc::EBADMSG,
+ EMULTIHOP = libc::EMULTIHOP,
+ ENODATA = libc::ENODATA,
+ ENOLINK = libc::ENOLINK,
+ ENOSR = libc::ENOSR,
+ ENOSTR = libc::ENOSTR,
+ EPROTO = libc::EPROTO,
+ ETIME = libc::ETIME,
+ EOPNOTSUPP = libc::EOPNOTSUPP,
+ ENOPOLICY = libc::ENOPOLICY,
+ ENOTRECOVERABLE = libc::ENOTRECOVERABLE,
+ EOWNERDEAD = libc::EOWNERDEAD,
+ EQFULL = libc::EQFULL,
}
pub const ELAST: Errno = Errno::EQFULL;
@@ -938,113 +940,113 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
- 1 => EPERM,
- 2 => ENOENT,
- 3 => ESRCH,
- 4 => EINTR,
- 5 => EIO,
- 6 => ENXIO,
- 7 => E2BIG,
- 8 => ENOEXEC,
- 9 => EBADF,
- 10 => ECHILD,
- 11 => EDEADLK,
- 12 => ENOMEM,
- 13 => EACCES,
- 14 => EFAULT,
- 15 => ENOTBLK,
- 16 => EBUSY,
- 17 => EEXIST,
- 18 => EXDEV,
- 19 => ENODEV,
- 20 => ENOTDIR,
- 21 => EISDIR,
- 22 => EINVAL,
- 23 => ENFILE,
- 24 => EMFILE,
- 25 => ENOTTY,
- 26 => ETXTBSY,
- 27 => EFBIG,
- 28 => ENOSPC,
- 29 => ESPIPE,
- 30 => EROFS,
- 31 => EMLINK,
- 32 => EPIPE,
- 33 => EDOM,
- 34 => ERANGE,
- 35 => EAGAIN,
- 36 => EINPROGRESS,
- 37 => EALREADY,
- 38 => ENOTSOCK,
- 39 => EDESTADDRREQ,
- 40 => EMSGSIZE,
- 41 => EPROTOTYPE,
- 42 => ENOPROTOOPT,
- 43 => EPROTONOSUPPORT,
- 44 => ESOCKTNOSUPPORT,
- 45 => ENOTSUP,
- 46 => EPFNOSUPPORT,
- 47 => EAFNOSUPPORT,
- 48 => EADDRINUSE,
- 49 => EADDRNOTAVAIL,
- 50 => ENETDOWN,
- 51 => ENETUNREACH,
- 52 => ENETRESET,
- 53 => ECONNABORTED,
- 54 => ECONNRESET,
- 55 => ENOBUFS,
- 56 => EISCONN,
- 57 => ENOTCONN,
- 58 => ESHUTDOWN,
- 59 => ETOOMANYREFS,
- 60 => ETIMEDOUT,
- 61 => ECONNREFUSED,
- 62 => ELOOP,
- 63 => ENAMETOOLONG,
- 64 => EHOSTDOWN,
- 65 => EHOSTUNREACH,
- 66 => ENOTEMPTY,
- 67 => EPROCLIM,
- 68 => EUSERS,
- 69 => EDQUOT,
- 70 => ESTALE,
- 71 => EREMOTE,
- 72 => EBADRPC,
- 73 => ERPCMISMATCH,
- 74 => EPROGUNAVAIL,
- 75 => EPROGMISMATCH,
- 76 => EPROCUNAVAIL,
- 77 => ENOLCK,
- 78 => ENOSYS,
- 79 => EFTYPE,
- 80 => EAUTH,
- 81 => ENEEDAUTH,
- 82 => EPWROFF,
- 83 => EDEVERR,
- 84 => EOVERFLOW,
- 85 => EBADEXEC,
- 86 => EBADARCH,
- 87 => ESHLIBVERS,
- 88 => EBADMACHO,
- 89 => ECANCELED,
- 90 => EIDRM,
- 91 => ENOMSG,
- 92 => EILSEQ,
- 93 => ENOATTR,
- 94 => EBADMSG,
- 95 => EMULTIHOP,
- 96 => ENODATA,
- 97 => ENOLINK,
- 98 => ENOSR,
- 99 => ENOSTR,
- 100 => EPROTO,
- 101 => ETIME,
- 102 => EOPNOTSUPP,
- 103 => ENOPOLICY,
- 104 => ENOTRECOVERABLE,
- 105 => EOWNERDEAD,
- 106 => EQFULL,
+ 0 => UnknownErrno,
+ libc::EPERM => EPERM,
+ libc::ENOENT => ENOENT,
+ libc::ESRCH => ESRCH,
+ libc::EINTR => EINTR,
+ libc::EIO => EIO,
+ libc::ENXIO => ENXIO,
+ libc::E2BIG => E2BIG,
+ libc::ENOEXEC => ENOEXEC,
+ libc::EBADF => EBADF,
+ libc::ECHILD => ECHILD,
+ libc::EDEADLK => EDEADLK,
+ libc::ENOMEM => ENOMEM,
+ libc::EACCES => EACCES,
+ libc::EFAULT => EFAULT,
+ libc::ENOTBLK => ENOTBLK,
+ libc::EBUSY => EBUSY,
+ libc::EEXIST => EEXIST,
+ libc::EXDEV => EXDEV,
+ libc::ENODEV => ENODEV,
+ libc::ENOTDIR => ENOTDIR,
+ libc::EISDIR => EISDIR,
+ libc::EINVAL => EINVAL,
+ libc::ENFILE => ENFILE,
+ libc::EMFILE => EMFILE,
+ libc::ENOTTY => ENOTTY,
+ libc::ETXTBSY => ETXTBSY,
+ libc::EFBIG => EFBIG,
+ libc::ENOSPC => ENOSPC,
+ libc::ESPIPE => ESPIPE,
+ libc::EROFS => EROFS,
+ libc::EMLINK => EMLINK,
+ libc::EPIPE => EPIPE,
+ libc::EDOM => EDOM,
+ libc::ERANGE => ERANGE,
+ libc::EAGAIN => EAGAIN,
+ libc::EINPROGRESS => EINPROGRESS,
+ libc::EALREADY => EALREADY,
+ libc::ENOTSOCK => ENOTSOCK,
+ libc::EDESTADDRREQ => EDESTADDRREQ,
+ libc::EMSGSIZE => EMSGSIZE,
+ libc::EPROTOTYPE => EPROTOTYPE,
+ libc::ENOPROTOOPT => ENOPROTOOPT,
+ libc::EPROTONOSUPPORT => EPROTONOSUPPORT,
+ libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT,
+ libc::ENOTSUP => ENOTSUP,
+ libc::EPFNOSUPPORT => EPFNOSUPPORT,
+ libc::EAFNOSUPPORT => EAFNOSUPPORT,
+ libc::EADDRINUSE => EADDRINUSE,
+ libc::EADDRNOTAVAIL => EADDRNOTAVAIL,
+ libc::ENETDOWN => ENETDOWN,
+ libc::ENETUNREACH => ENETUNREACH,
+ libc::ENETRESET => ENETRESET,
+ libc::ECONNABORTED => ECONNABORTED,
+ libc::ECONNRESET => ECONNRESET,
+ libc::ENOBUFS => ENOBUFS,
+ libc::EISCONN => EISCONN,
+ libc::ENOTCONN => ENOTCONN,
+ libc::ESHUTDOWN => ESHUTDOWN,
+ libc::ETOOMANYREFS => ETOOMANYREFS,
+ libc::ETIMEDOUT => ETIMEDOUT,
+ libc::ECONNREFUSED => ECONNREFUSED,
+ libc::ELOOP => ELOOP,
+ libc::ENAMETOOLONG => ENAMETOOLONG,
+ libc::EHOSTDOWN => EHOSTDOWN,
+ libc::EHOSTUNREACH => EHOSTUNREACH,
+ libc::ENOTEMPTY => ENOTEMPTY,
+ libc::EPROCLIM => EPROCLIM,
+ libc::EUSERS => EUSERS,
+ libc::EDQUOT => EDQUOT,
+ libc::ESTALE => ESTALE,
+ libc::EREMOTE => EREMOTE,
+ libc::EBADRPC => EBADRPC,
+ libc::ERPCMISMATCH => ERPCMISMATCH,
+ libc::EPROGUNAVAIL => EPROGUNAVAIL,
+ libc::EPROGMISMATCH => EPROGMISMATCH,
+ libc::EPROCUNAVAIL => EPROCUNAVAIL,
+ libc::ENOLCK => ENOLCK,
+ libc::ENOSYS => ENOSYS,
+ libc::EFTYPE => EFTYPE,
+ libc::EAUTH => EAUTH,
+ libc::ENEEDAUTH => ENEEDAUTH,
+ libc::EPWROFF => EPWROFF,
+ libc::EDEVERR => EDEVERR,
+ libc::EOVERFLOW => EOVERFLOW,
+ libc::EBADEXEC => EBADEXEC,
+ libc::EBADARCH => EBADARCH,
+ libc::ESHLIBVERS => ESHLIBVERS,
+ libc::EBADMACHO => EBADMACHO,
+ libc::ECANCELED => ECANCELED,
+ libc::EIDRM => EIDRM,
+ libc::ENOMSG => ENOMSG,
+ libc::EILSEQ => EILSEQ,
+ libc::ENOATTR => ENOATTR,
+ libc::EBADMSG => EBADMSG,
+ libc::EMULTIHOP => EMULTIHOP,
+ libc::ENODATA => ENODATA,
+ libc::ENOLINK => ENOLINK,
+ libc::ENOSR => ENOSR,
+ libc::ENOSTR => ENOSTR,
+ libc::EPROTO => EPROTO,
+ libc::ETIME => ETIME,
+ libc::EOPNOTSUPP => EOPNOTSUPP,
+ libc::ENOPOLICY => ENOPOLICY,
+ libc::ENOTRECOVERABLE => ENOTRECOVERABLE,
+ libc::EOWNERDEAD => EOWNERDEAD,
+ libc::EQFULL => EQFULL,
_ => UnknownErrno,
}
}
@@ -1052,106 +1054,108 @@ mod consts {
#[cfg(target_os = "freebsd")]
mod consts {
- #[derive(Copy, Debug, Clone, PartialEq)]
+ use libc;
+
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ #[repr(i32)]
pub enum Errno {
UnknownErrno = 0,
- EPERM = 1,
- ENOENT = 2,
- ESRCH = 3,
- EINTR = 4,
- EIO = 5,
- ENXIO = 6,
- E2BIG = 7,
- ENOEXEC = 8,
- EBADF = 9,
- ECHILD = 10,
- EDEADLK = 11,
- ENOMEM = 12,
- EACCES = 13,
- EFAULT = 14,
- ENOTBLK = 15,
- EBUSY = 16,
- EEXIST = 17,
- EXDEV = 18,
- ENODEV = 19,
- ENOTDIR = 20,
- EISDIR = 21,
- EINVAL = 22,
- ENFILE = 23,
- EMFILE = 24,
- ENOTTY = 25,
- ETXTBSY = 26,
- EFBIG = 27,
- ENOSPC = 28,
- ESPIPE = 29,
- EROFS = 30,
- EMLINK = 31,
- EPIPE = 32,
- EDOM = 33,
- ERANGE = 34,
- EAGAIN = 35,
- EINPROGRESS = 36,
- EALREADY = 37,
- ENOTSOCK = 38,
- EDESTADDRREQ = 39,
- EMSGSIZE = 40,
- EPROTOTYPE = 41,
- ENOPROTOOPT = 42,
- EPROTONOSUPPORT = 43,
- ESOCKTNOSUPPORT = 44,
- ENOTSUP = 45,
- EPFNOSUPPORT = 46,
- EAFNOSUPPORT = 47,
- EADDRINUSE = 48,
- EADDRNOTAVAIL = 49,
- ENETDOWN = 50,
- ENETUNREACH = 51,
- ENETRESET = 52,
- ECONNABORTED = 53,
- ECONNRESET = 54,
- ENOBUFS = 55,
- EISCONN = 56,
- ENOTCONN = 57,
- ESHUTDOWN = 58,
- ETOOMANYREFS = 59,
- ETIMEDOUT = 60,
- ECONNREFUSED = 61,
- ELOOP = 62,
- ENAMETOOLONG = 63,
- EHOSTDOWN = 64,
- EHOSTUNREACH = 65,
- ENOTEMPTY = 66,
- EPROCLIM = 67,
- EUSERS = 68,
- EDQUOT = 69,
- ESTALE = 70,
- EREMOTE = 71,
- EBADRPC = 72,
- ERPCMISMATCH = 73,
- EPROGUNAVAIL = 74,
- EPROGMISMATCH = 75,
- EPROCUNAVAIL = 76,
- ENOLCK = 77,
- ENOSYS = 78,
- EFTYPE = 79,
- EAUTH = 80,
- ENEEDAUTH = 81,
- EIDRM = 82,
- ENOMSG = 83,
- EOVERFLOW = 84,
- ECANCELED = 85,
- EILSEQ = 86,
- ENOATTR = 87,
- EDOOFUS = 88,
- EBADMSG = 89,
- EMULTIHOP = 90,
- ENOLINK = 91,
- EPROTO = 92,
- ENOTCAPABLE = 93,
- ECAPMODE = 94,
- ENOTRECOVERABLE = 95,
- EOWNERDEAD = 96
-
+ EPERM = libc::EPERM,
+ ENOENT = libc::ENOENT,
+ ESRCH = libc::ESRCH,
+ EINTR = libc::EINTR,
+ EIO = libc::EIO,
+ ENXIO = libc::ENXIO,
+ E2BIG = libc::E2BIG,
+ ENOEXEC = libc::ENOEXEC,
+ EBADF = libc::EBADF,
+ ECHILD = libc::ECHILD,
+ EDEADLK = libc::EDEADLK,
+ ENOMEM = libc::ENOMEM,
+ EACCES = libc::EACCES,
+ EFAULT = libc::EFAULT,
+ ENOTBLK = libc::ENOTBLK,
+ EBUSY = libc::EBUSY,
+ EEXIST = libc::EEXIST,
+ EXDEV = libc::EXDEV,
+ ENODEV = libc::ENODEV,
+ ENOTDIR = libc::ENOTDIR,
+ EISDIR = libc::EISDIR,
+ EINVAL = libc::EINVAL,
+ ENFILE = libc::ENFILE,
+ EMFILE = libc::EMFILE,
+ ENOTTY = libc::ENOTTY,
+ ETXTBSY = libc::ETXTBSY,
+ EFBIG = libc::EFBIG,
+ ENOSPC = libc::ENOSPC,
+ ESPIPE = libc::ESPIPE,
+ EROFS = libc::EROFS,
+ EMLINK = libc::EMLINK,
+ EPIPE = libc::EPIPE,
+ EDOM = libc::EDOM,
+ ERANGE = libc::ERANGE,
+ EAGAIN = libc::EAGAIN,
+ EINPROGRESS = libc::EINPROGRESS,
+ EALREADY = libc::EALREADY,
+ ENOTSOCK = libc::ENOTSOCK,
+ EDESTADDRREQ = libc::EDESTADDRREQ,
+ EMSGSIZE = libc::EMSGSIZE,
+ EPROTOTYPE = libc::EPROTOTYPE,
+ ENOPROTOOPT = libc::ENOPROTOOPT,
+ EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
+ ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT,
+ ENOTSUP = libc::ENOTSUP,
+ EPFNOSUPPORT = libc::EPFNOSUPPORT,
+ EAFNOSUPPORT = libc::EAFNOSUPPORT,
+ EADDRINUSE = libc::EADDRINUSE,
+ EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
+ ENETDOWN = libc::ENETDOWN,
+ ENETUNREACH = libc::ENETUNREACH,
+ ENETRESET = libc::ENETRESET,
+ ECONNABORTED = libc::ECONNABORTED,
+ ECONNRESET = libc::ECONNRESET,
+ ENOBUFS = libc::ENOBUFS,
+ EISCONN = libc::EISCONN,
+ ENOTCONN = libc::ENOTCONN,
+ ESHUTDOWN = libc::ESHUTDOWN,
+ ETOOMANYREFS = libc::ETOOMANYREFS,
+ ETIMEDOUT = libc::ETIMEDOUT,
+ ECONNREFUSED = libc::ECONNREFUSED,
+ ELOOP = libc::ELOOP,
+ ENAMETOOLONG = libc::ENAMETOOLONG,
+ EHOSTDOWN = libc::EHOSTDOWN,
+ EHOSTUNREACH = libc::EHOSTUNREACH,
+ ENOTEMPTY = libc::ENOTEMPTY,
+ EPROCLIM = libc::EPROCLIM,
+ EUSERS = libc::EUSERS,
+ EDQUOT = libc::EDQUOT,
+ ESTALE = libc::ESTALE,
+ EREMOTE = libc::EREMOTE,
+ EBADRPC = libc::EBADRPC,
+ ERPCMISMATCH = libc::ERPCMISMATCH,
+ EPROGUNAVAIL = libc::EPROGUNAVAIL,
+ EPROGMISMATCH = libc::EPROGMISMATCH,
+ EPROCUNAVAIL = libc::EPROCUNAVAIL,
+ ENOLCK = libc::ENOLCK,
+ ENOSYS = libc::ENOSYS,
+ EFTYPE = libc::EFTYPE,
+ EAUTH = libc::EAUTH,
+ ENEEDAUTH = libc::ENEEDAUTH,
+ EIDRM = libc::EIDRM,
+ ENOMSG = libc::ENOMSG,
+ EOVERFLOW = libc::EOVERFLOW,
+ ECANCELED = libc::ECANCELED,
+ EILSEQ = libc::EILSEQ,
+ ENOATTR = libc::ENOATTR,
+ EDOOFUS = libc::EDOOFUS,
+ EBADMSG = libc::EBADMSG,
+ EMULTIHOP = libc::EMULTIHOP,
+ ENOLINK = libc::ENOLINK,
+ EPROTO = libc::EPROTO,
+ ENOTCAPABLE = libc::ENOTCAPABLE,
+ ECAPMODE = libc::ECAPMODE,
+ ENOTRECOVERABLE = libc::ENOTRECOVERABLE,
+ EOWNERDEAD = libc::EOWNERDEAD,
}
pub const ELAST: Errno = Errno::EOWNERDEAD;
@@ -1164,103 +1168,103 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
- 1 => EPERM,
- 2 => ENOENT,
- 3 => ESRCH,
- 4 => EINTR,
- 5 => EIO,
- 6 => ENXIO,
- 7 => E2BIG,
- 8 => ENOEXEC,
- 9 => EBADF,
- 10 => ECHILD,
- 11 => EDEADLK,
- 12 => ENOMEM,
- 13 => EACCES,
- 14 => EFAULT,
- 15 => ENOTBLK,
- 16 => EBUSY,
- 17 => EEXIST,
- 18 => EXDEV,
- 19 => ENODEV,
- 20 => ENOTDIR,
- 21 => EISDIR,
- 22 => EINVAL,
- 23 => ENFILE,
- 24 => EMFILE,
- 25 => ENOTTY,
- 26 => ETXTBSY,
- 27 => EFBIG,
- 28 => ENOSPC,
- 29 => ESPIPE,
- 30 => EROFS,
- 31 => EMLINK,
- 32 => EPIPE,
- 33 => EDOM,
- 34 => ERANGE,
- 35 => EAGAIN,
- 36 => EINPROGRESS,
- 37 => EALREADY,
- 38 => ENOTSOCK,
- 39 => EDESTADDRREQ,
- 40 => EMSGSIZE,
- 41 => EPROTOTYPE,
- 42 => ENOPROTOOPT,
- 43 => EPROTONOSUPPORT,
- 44 => ESOCKTNOSUPPORT,
- 45 => ENOTSUP,
- 46 => EPFNOSUPPORT,
- 47 => EAFNOSUPPORT,
- 48 => EADDRINUSE,
- 49 => EADDRNOTAVAIL,
- 50 => ENETDOWN,
- 51 => ENETUNREACH,
- 52 => ENETRESET,
- 53 => ECONNABORTED,
- 54 => ECONNRESET,
- 55 => ENOBUFS,
- 56 => EISCONN,
- 57 => ENOTCONN,
- 58 => ESHUTDOWN,
- 59 => ETOOMANYREFS,
- 60 => ETIMEDOUT,
- 61 => ECONNREFUSED,
- 62 => ELOOP,
- 63 => ENAMETOOLONG,
- 64 => EHOSTDOWN,
- 65 => EHOSTUNREACH,
- 66 => ENOTEMPTY,
- 67 => EPROCLIM,
- 68 => EUSERS,
- 69 => EDQUOT,
- 70 => ESTALE,
- 71 => EREMOTE,
- 72 => EBADRPC,
- 73 => ERPCMISMATCH,
- 74 => EPROGUNAVAIL,
- 75 => EPROGMISMATCH,
- 76 => EPROCUNAVAIL,
- 77 => ENOLCK,
- 78 => ENOSYS,
- 79 => EFTYPE,
- 80 => EAUTH,
- 81 => ENEEDAUTH,
- 82 => EIDRM,
- 83 => ENOMSG,
- 84 => EOVERFLOW,
- 85 => ECANCELED,
- 86 => EILSEQ,
- 87 => ENOATTR,
- 88 => EDOOFUS,
- 89 => EBADMSG,
- 90 => EMULTIHOP,
- 91 => ENOLINK,
- 92 => EPROTO,
- 93 => ENOTCAPABLE,
- 94 => ECAPMODE,
- 95 => ENOTRECOVERABLE,
- 96 => EOWNERDEAD,
+ 0 => UnknownErrno,
+ libc::EPERM => EPERM,
+ libc::ENOENT => ENOENT,
+ libc::ESRCH => ESRCH,
+ libc::EINTR => EINTR,
+ libc::EIO => EIO,
+ libc::ENXIO => ENXIO,
+ libc::E2BIG => E2BIG,
+ libc::ENOEXEC => ENOEXEC,
+ libc::EBADF => EBADF,
+ libc::ECHILD => ECHILD,
+ libc::EDEADLK => EDEADLK,
+ libc::ENOMEM => ENOMEM,
+ libc::EACCES => EACCES,
+ libc::EFAULT => EFAULT,
+ libc::ENOTBLK => ENOTBLK,
+ libc::EBUSY => EBUSY,
+ libc::EEXIST => EEXIST,
+ libc::EXDEV => EXDEV,
+ libc::ENODEV => ENODEV,
+ libc::ENOTDIR => ENOTDIR,
+ libc::EISDIR => EISDIR,
+ libc::EINVAL => EINVAL,
+ libc::ENFILE => ENFILE,
+ libc::EMFILE => EMFILE,
+ libc::ENOTTY => ENOTTY,
+ libc::ETXTBSY => ETXTBSY,
+ libc::EFBIG => EFBIG,
+ libc::ENOSPC => ENOSPC,
+ libc::ESPIPE => ESPIPE,
+ libc::EROFS => EROFS,
+ libc::EMLINK => EMLINK,
+ libc::EPIPE => EPIPE,
+ libc::EDOM => EDOM,
+ libc::ERANGE => ERANGE,
+ libc::EAGAIN => EAGAIN,
+ libc::EINPROGRESS => EINPROGRESS,
+ libc::EALREADY => EALREADY,
+ libc::ENOTSOCK => ENOTSOCK,
+ libc::EDESTADDRREQ => EDESTADDRREQ,
+ libc::EMSGSIZE => EMSGSIZE,
+ libc::EPROTOTYPE => EPROTOTYPE,
+ libc::ENOPROTOOPT => ENOPROTOOPT,
+ libc::EPROTONOSUPPORT => EPROTONOSUPPORT,
+ libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT,
+ libc::ENOTSUP => ENOTSUP,
+ libc::EPFNOSUPPORT => EPFNOSUPPORT,
+ libc::EAFNOSUPPORT => EAFNOSUPPORT,
+ libc::EADDRINUSE => EADDRINUSE,
+ libc::EADDRNOTAVAIL => EADDRNOTAVAIL,
+ libc::ENETDOWN => ENETDOWN,
+ libc::ENETUNREACH => ENETUNREACH,
+ libc::ENETRESET => ENETRESET,
+ libc::ECONNABORTED => ECONNABORTED,
+ libc::ECONNRESET => ECONNRESET,
+ libc::ENOBUFS => ENOBUFS,
+ libc::EISCONN => EISCONN,
+ libc::ENOTCONN => ENOTCONN,
+ libc::ESHUTDOWN => ESHUTDOWN,
+ libc::ETOOMANYREFS => ETOOMANYREFS,
+ libc::ETIMEDOUT => ETIMEDOUT,
+ libc::ECONNREFUSED => ECONNREFUSED,
+ libc::ELOOP => ELOOP,
+ libc::ENAMETOOLONG => ENAMETOOLONG,
+ libc::EHOSTDOWN => EHOSTDOWN,
+ libc::EHOSTUNREACH => EHOSTUNREACH,
+ libc::ENOTEMPTY => ENOTEMPTY,
+ libc::EPROCLIM => EPROCLIM,
+ libc::EUSERS => EUSERS,
+ libc::EDQUOT => EDQUOT,
+ libc::ESTALE => ESTALE,
+ libc::EREMOTE => EREMOTE,
+ libc::EBADRPC => EBADRPC,
+ libc::ERPCMISMATCH => ERPCMISMATCH,
+ libc::EPROGUNAVAIL => EPROGUNAVAIL,
+ libc::EPROGMISMATCH => EPROGMISMATCH,
+ libc::EPROCUNAVAIL => EPROCUNAVAIL,
+ libc::ENOLCK => ENOLCK,
+ libc::ENOSYS => ENOSYS,
+ libc::EFTYPE => EFTYPE,
+ libc::EAUTH => EAUTH,
+ libc::ENEEDAUTH => ENEEDAUTH,
+ libc::EIDRM => EIDRM,
+ libc::ENOMSG => ENOMSG,
+ libc::EOVERFLOW => EOVERFLOW,
+ libc::ECANCELED => ECANCELED,
+ libc::EILSEQ => EILSEQ,
+ libc::ENOATTR => ENOATTR,
+ libc::EDOOFUS => EDOOFUS,
+ libc::EBADMSG => EBADMSG,
+ libc::EMULTIHOP => EMULTIHOP,
+ libc::ENOLINK => ENOLINK,
+ libc::EPROTO => EPROTO,
+ libc::ENOTCAPABLE => ENOTCAPABLE,
+ libc::ECAPMODE => ECAPMODE,
+ libc::ENOTRECOVERABLE => ENOTRECOVERABLE,
+ libc::EOWNERDEAD => EOWNERDEAD,
_ => UnknownErrno,
}
}
@@ -1269,109 +1273,111 @@ mod consts {
#[cfg(target_os = "dragonfly")]
mod consts {
- #[derive(Copy, Debug, Clone, PartialEq)]
+ use libc;
+
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ #[repr(i32)]
pub enum Errno {
UnknownErrno = 0,
- EPERM = 1,
- ENOENT = 2,
- ESRCH = 3,
- EINTR = 4,
- EIO = 5,
- ENXIO = 6,
- E2BIG = 7,
- ENOEXEC = 8,
- EBADF = 9,
- ECHILD = 10,
- EDEADLK = 11,
- ENOMEM = 12,
- EACCES = 13,
- EFAULT = 14,
- ENOTBLK = 15,
- EBUSY = 16,
- EEXIST = 17,
- EXDEV = 18,
- ENODEV = 19,
- ENOTDIR = 20,
- EISDIR = 21,
- EINVAL = 22,
- ENFILE = 23,
- EMFILE = 24,
- ENOTTY = 25,
- ETXTBSY = 26,
- EFBIG = 27,
- ENOSPC = 28,
- ESPIPE = 29,
- EROFS = 30,
- EMLINK = 31,
- EPIPE = 32,
- EDOM = 33,
- ERANGE = 34,
- EAGAIN = 35,
- EINPROGRESS = 36,
- EALREADY = 37,
- ENOTSOCK = 38,
- EDESTADDRREQ = 39,
- EMSGSIZE = 40,
- EPROTOTYPE = 41,
- ENOPROTOOPT = 42,
- EPROTONOSUPPORT = 43,
- ESOCKTNOSUPPORT = 44,
- ENOTSUP = 45,
- EPFNOSUPPORT = 46,
- EAFNOSUPPORT = 47,
- EADDRINUSE = 48,
- EADDRNOTAVAIL = 49,
- ENETDOWN = 50,
- ENETUNREACH = 51,
- ENETRESET = 52,
- ECONNABORTED = 53,
- ECONNRESET = 54,
- ENOBUFS = 55,
- EISCONN = 56,
- ENOTCONN = 57,
- ESHUTDOWN = 58,
- ETOOMANYREFS = 59,
- ETIMEDOUT = 60,
- ECONNREFUSED = 61,
- ELOOP = 62,
- ENAMETOOLONG = 63,
- EHOSTDOWN = 64,
- EHOSTUNREACH = 65,
- ENOTEMPTY = 66,
- EPROCLIM = 67,
- EUSERS = 68,
- EDQUOT = 69,
- ESTALE = 70,
- EREMOTE = 71,
- EBADRPC = 72,
- ERPCMISMATCH = 73,
- EPROGUNAVAIL = 74,
- EPROGMISMATCH = 75,
- EPROCUNAVAIL = 76,
- ENOLCK = 77,
- ENOSYS = 78,
- EFTYPE = 79,
- EAUTH = 80,
- ENEEDAUTH = 81,
- EIDRM = 82,
- ENOMSG = 83,
- EOVERFLOW = 84,
- ECANCELED = 85,
- EILSEQ = 86,
- ENOATTR = 87,
- EDOOFUS = 88,
- EBADMSG = 89,
- EMULTIHOP = 90,
- ENOLINK = 91,
- EPROTO = 92,
-
- ENOMEDIUM = 93,
- EUNUSED94 = 94,
- EUNUSED95 = 95,
- EUNUSED96 = 96,
- EUNUSED97 = 97,
- EUNUSED98 = 98,
- EASYNC = 99,
+ EPERM = libc::EPERM,
+ ENOENT = libc::ENOENT,
+ ESRCH = libc::ESRCH,
+ EINTR = libc::EINTR,
+ EIO = libc::EIO,
+ ENXIO = libc::ENXIO,
+ E2BIG = libc::E2BIG,
+ ENOEXEC = libc::ENOEXEC,
+ EBADF = libc::EBADF,
+ ECHILD = libc::ECHILD,
+ EDEADLK = libc::EDEADLK,
+ ENOMEM = libc::ENOMEM,
+ EACCES = libc::EACCES,
+ EFAULT = libc::EFAULT,
+ ENOTBLK = libc::ENOTBLK,
+ EBUSY = libc::EBUSY,
+ EEXIST = libc::EEXIST,
+ EXDEV = libc::EXDEV,
+ ENODEV = libc::ENODEV,
+ ENOTDIR = libc::ENOTDIR,
+ EISDIR = libc::EISDIR,
+ EINVAL = libc::EINVAL,
+ ENFILE = libc::ENFILE,
+ EMFILE = libc::EMFILE,
+ ENOTTY = libc::ENOTTY,
+ ETXTBSY = libc::ETXTBSY,
+ EFBIG = libc::EFBIG,
+ ENOSPC = libc::ENOSPC,
+ ESPIPE = libc::ESPIPE,
+ EROFS = libc::EROFS,
+ EMLINK = libc::EMLINK,
+ EPIPE = libc::EPIPE,
+ EDOM = libc::EDOM,
+ ERANGE = libc::ERANGE,
+ EAGAIN = libc::EAGAIN,
+ EINPROGRESS = libc::EINPROGRESS,
+ EALREADY = libc::EALREADY,
+ ENOTSOCK = libc::ENOTSOCK,
+ EDESTADDRREQ = libc::EDESTADDRREQ,
+ EMSGSIZE = libc::EMSGSIZE,
+ EPROTOTYPE = libc::EPROTOTYPE,
+ ENOPROTOOPT = libc::ENOPROTOOPT,
+ EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
+ ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT,
+ ENOTSUP = libc::ENOTSUP,
+ EPFNOSUPPORT = libc::EPFNOSUPPORT,
+ EAFNOSUPPORT = libc::EAFNOSUPPORT,
+ EADDRINUSE = libc::EADDRINUSE,
+ EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
+ ENETDOWN = libc::ENETDOWN,
+ ENETUNREACH = libc::ENETUNREACH,
+ ENETRESET = libc::ENETRESET,
+ ECONNABORTED = libc::ECONNABORTED,
+ ECONNRESET = libc::ECONNRESET,
+ ENOBUFS = libc::ENOBUFS,
+ EISCONN = libc::EISCONN,
+ ENOTCONN = libc::ENOTCONN,
+ ESHUTDOWN = libc::ESHUTDOWN,
+ ETOOMANYREFS = libc::ETOOMANYREFS,
+ ETIMEDOUT = libc::ETIMEDOUT,
+ ECONNREFUSED = libc::ECONNREFUSED,
+ ELOOP = libc::ELOOP,
+ ENAMETOOLONG = libc::ENAMETOOLONG,
+ EHOSTDOWN = libc::EHOSTDOWN,
+ EHOSTUNREACH = libc::EHOSTUNREACH,
+ ENOTEMPTY = libc::ENOTEMPTY,
+ EPROCLIM = libc::EPROCLIM,
+ EUSERS = libc::EUSERS,
+ EDQUOT = libc::EDQUOT,
+ ESTALE = libc::ESTALE,
+ EREMOTE = libc::EREMOTE,
+ EBADRPC = libc::EBADRPC,
+ ERPCMISMATCH = libc::ERPCMISMATCH,
+ EPROGUNAVAIL = libc::EPROGUNAVAIL,
+ EPROGMISMATCH = libc::EPROGMISMATCH,
+ EPROCUNAVAIL = libc::EPROCUNAVAIL,
+ ENOLCK = libc::ENOLCK,
+ ENOSYS = libc::ENOSYS,
+ EFTYPE = libc::EFTYPE,
+ EAUTH = libc::EAUTH,
+ ENEEDAUTH = libc::ENEEDAUTH,
+ EIDRM = libc::EIDRM,
+ ENOMSG = libc::ENOMSG,
+ EOVERFLOW = libc::EOVERFLOW,
+ ECANCELED = libc::ECANCELED,
+ EILSEQ = libc::EILSEQ,
+ ENOATTR = libc::ENOATTR,
+ EDOOFUS = libc::EDOOFUS,
+ EBADMSG = libc::EBADMSG,
+ EMULTIHOP = libc::EMULTIHOP,
+ ENOLINK = libc::ENOLINK,
+ EPROTO = libc::EPROTO,
+ ENOMEDIUM = libc::ENOMEDIUM,
+ EUNUSED94 = libc::EUNUSED94,
+ EUNUSED95 = libc::EUNUSED95,
+ EUNUSED96 = libc::EUNUSED96,
+ EUNUSED97 = libc::EUNUSED97,
+ EUNUSED98 = libc::EUNUSED98,
+ EASYNC = libc::EASYNC,
}
pub const ELAST: Errno = Errno::EASYNC;
@@ -1385,106 +1391,106 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
- 1 => EPERM,
- 2 => ENOENT,
- 3 => ESRCH,
- 4 => EINTR,
- 5 => EIO,
- 6 => ENXIO,
- 7 => E2BIG,
- 8 => ENOEXEC,
- 9 => EBADF,
- 10 => ECHILD,
- 11 => EDEADLK,
- 12 => ENOMEM,
- 13 => EACCES,
- 14 => EFAULT,
- 15 => ENOTBLK,
- 16 => EBUSY,
- 17 => EEXIST,
- 18 => EXDEV,
- 19 => ENODEV,
- 20 => ENOTDIR,
- 21 => EISDIR,
- 22 => EINVAL,
- 23 => ENFILE,
- 24 => EMFILE,
- 25 => ENOTTY,
- 26 => ETXTBSY,
- 27 => EFBIG,
- 28 => ENOSPC,
- 29 => ESPIPE,
- 30 => EROFS,
- 31 => EMLINK,
- 32 => EPIPE,
- 33 => EDOM,
- 34 => ERANGE,
- 35 => EAGAIN,
- 36 => EINPROGRESS,
- 37 => EALREADY,
- 38 => ENOTSOCK,
- 39 => EDESTADDRREQ,
- 40 => EMSGSIZE,
- 41 => EPROTOTYPE,
- 42 => ENOPROTOOPT,
- 43 => EPROTONOSUPPORT,
- 44 => ESOCKTNOSUPPORT,
- 45 => ENOTSUP,
- 46 => EPFNOSUPPORT,
- 47 => EAFNOSUPPORT,
- 48 => EADDRINUSE,
- 49 => EADDRNOTAVAIL,
- 50 => ENETDOWN,
- 51 => ENETUNREACH,
- 52 => ENETRESET,
- 53 => ECONNABORTED,
- 54 => ECONNRESET,
- 55 => ENOBUFS,
- 56 => EISCONN,
- 57 => ENOTCONN,
- 58 => ESHUTDOWN,
- 59 => ETOOMANYREFS,
- 60 => ETIMEDOUT,
- 61 => ECONNREFUSED,
- 62 => ELOOP,
- 63 => ENAMETOOLONG,
- 64 => EHOSTDOWN,
- 65 => EHOSTUNREACH,
- 66 => ENOTEMPTY,
- 67 => EPROCLIM,
- 68 => EUSERS,
- 69 => EDQUOT,
- 70 => ESTALE,
- 71 => EREMOTE,
- 72 => EBADRPC,
- 73 => ERPCMISMATCH,
- 74 => EPROGUNAVAIL,
- 75 => EPROGMISMATCH,
- 76 => EPROCUNAVAIL,
- 77 => ENOLCK,
- 78 => ENOSYS,
- 79 => EFTYPE,
- 80 => EAUTH,
- 81 => ENEEDAUTH,
- 82 => EIDRM,
- 83 => ENOMSG,
- 84 => EOVERFLOW,
- 85 => ECANCELED,
- 86 => EILSEQ,
- 87 => ENOATTR,
- 88 => EDOOFUS,
- 89 => EBADMSG,
- 90 => EMULTIHOP,
- 91 => ENOLINK,
- 92 => EPROTO,
- 93 => ENOMEDIUM,
- 94 => EUNUSED94,
- 95 => EUNUSED95,
- 96 => EUNUSED96,
- 97 => EUNUSED97,
- 98 => EUNUSED98,
- 99 => EASYNC,
+ 0 => UnknownErrno,
+ libc::EPERM => EPERM,
+ libc::ENOENT => ENOENT,
+ libc::ESRCH => ESRCH,
+ libc::EINTR => EINTR,
+ libc::EIO => EIO,
+ libc::ENXIO => ENXIO,
+ libc::E2BIG => E2BIG,
+ libc::ENOEXEC => ENOEXEC,
+ libc::EBADF => EBADF,
+ libc::ECHILD => ECHILD,
+ libc::EDEADLK => EDEADLK,
+ libc::ENOMEM => ENOMEM,
+ libc::EACCES => EACCES,
+ libc::EFAULT => EFAULT,
+ libc::ENOTBLK => ENOTBLK,
+ libc::EBUSY => EBUSY,
+ libc::EEXIST => EEXIST,
+ libc::EXDEV => EXDEV,
+ libc::ENODEV => ENODEV,
+ libc::ENOTDIR => ENOTDIR,
+ libc::EISDIR=> EISDIR,
+ libc::EINVAL => EINVAL,
+ libc::ENFILE => ENFILE,
+ libc::EMFILE => EMFILE,
+ libc::ENOTTY => ENOTTY,
+ libc::ETXTBSY => ETXTBSY,
+ libc::EFBIG => EFBIG,
+ libc::ENOSPC => ENOSPC,
+ libc::ESPIPE => ESPIPE,
+ libc::EROFS => EROFS,
+ libc::EMLINK => EMLINK,
+ libc::EPIPE => EPIPE,
+ libc::EDOM => EDOM,
+ libc::ERANGE => ERANGE,
+ libc::EAGAIN => EAGAIN,
+ libc::EINPROGRESS => EINPROGRESS,
+ libc::EALREADY => EALREADY,
+ libc::ENOTSOCK => ENOTSOCK,
+ libc::EDESTADDRREQ => EDESTADDRREQ,
+ libc::EMSGSIZE => EMSGSIZE,
+ libc::EPROTOTYPE => EPROTOTYPE,
+ libc::ENOPROTOOPT => ENOPROTOOPT,
+ libc::EPROTONOSUPPORT => EPROTONOSUPPORT,
+ libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT,
+ libc::ENOTSUP => ENOTSUP,
+ libc::EPFNOSUPPORT => EPFNOSUPPORT,
+ libc::EAFNOSUPPORT => EAFNOSUPPORT,
+ libc::EADDRINUSE => EADDRINUSE,
+ libc::EADDRNOTAVAIL => EADDRNOTAVAIL,
+ libc::ENETDOWN => ENETDOWN,
+ libc::ENETUNREACH => ENETUNREACH,
+ libc::ENETRESET => ENETRESET,
+ libc::ECONNABORTED => ECONNABORTED,
+ libc::ECONNRESET => ECONNRESET,
+ libc::ENOBUFS => ENOBUFS,
+ libc::EISCONN => EISCONN,
+ libc::ENOTCONN => ENOTCONN,
+ libc::ESHUTDOWN => ESHUTDOWN,
+ libc::ETOOMANYREFS => ETOOMANYREFS,
+ libc::ETIMEDOUT => ETIMEDOUT,
+ libc::ECONNREFUSED => ECONNREFUSED,
+ libc::ELOOP => ELOOP,
+ libc::ENAMETOOLONG => ENAMETOOLONG,
+ libc::EHOSTDOWN => EHOSTDOWN,
+ libc::EHOSTUNREACH => EHOSTUNREACH,
+ libc::ENOTEMPTY => ENOTEMPTY,
+ libc::EPROCLIM => EPROCLIM,
+ libc::EUSERS => EUSERS,
+ libc::EDQUOT => EDQUOT,
+ libc::ESTALE => ESTALE,
+ libc::EREMOTE => EREMOTE,
+ libc::EBADRPC => EBADRPC,
+ libc::ERPCMISMATCH => ERPCMISMATCH,
+ libc::EPROGUNAVAIL => EPROGUNAVAIL,
+ libc::EPROGMISMATCH => EPROGMISMATCH,
+ libc::EPROCUNAVAIL => EPROCUNAVAIL,
+ libc::ENOLCK => ENOLCK,
+ libc::ENOSYS => ENOSYS,
+ libc::EFTYPE => EFTYPE,
+ libc::EAUTH => EAUTH,
+ libc::ENEEDAUTH => ENEEDAUTH,
+ libc::EIDRM => EIDRM,
+ libc::ENOMSG => ENOMSG,
+ libc::EOVERFLOW => EOVERFLOW,
+ libc::ECANCELED => ECANCELED,
+ libc::EILSEQ => EILSEQ,
+ libc::ENOATTR => ENOATTR,
+ libc::EDOOFUS => EDOOFUS,
+ libc::EBADMSG => EBADMSG,
+ libc::EMULTIHOP => EMULTIHOP,
+ libc::ENOLINK => ENOLINK,
+ libc::EPROTO => EPROTO,
+ libc::ENOMEDIUM => ENOMEDIUM,
+ libc::EUNUSED94 => EUNUSED94,
+ libc::EUNUSED95 => EUNUSED95,
+ libc::EUNUSED96 => EUNUSED96,
+ libc::EUNUSED97 => EUNUSED97,
+ libc::EUNUSED98 => EUNUSED98,
+ libc::EASYNC => EASYNC,
_ => UnknownErrno,
}
}
@@ -1493,100 +1499,103 @@ mod consts {
#[cfg(target_os = "openbsd")]
mod consts {
- #[derive(Copy, Debug, Clone, PartialEq)]
+ use libc;
+
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ #[repr(i32)]
pub enum Errno {
UnknownErrno = 0,
- EPERM = 1,
- ENOENT = 2,
- ESRCH = 3,
- EINTR = 4,
- EIO = 5,
- ENXIO = 6,
- E2BIG = 7,
- ENOEXEC = 8,
- EBADF = 9,
- ECHILD = 10,
- EDEADLK = 11,
- ENOMEM = 12,
- EACCES = 13,
- EFAULT = 14,
- ENOTBLK = 15,
- EBUSY = 16,
- EEXIST = 17,
- EXDEV = 18,
- ENODEV = 19,
- ENOTDIR = 20,
- EISDIR = 21,
- EINVAL = 22,
- ENFILE = 23,
- EMFILE = 24,
- ENOTTY = 25,
- ETXTBSY = 26,
- EFBIG = 27,
- ENOSPC = 28,
- ESPIPE = 29,
- EROFS = 30,
- EMLINK = 31,
- EPIPE = 32,
- EDOM = 33,
- ERANGE = 34,
- EAGAIN = 35,
- EINPROGRESS = 36,
- EALREADY = 37,
- ENOTSOCK = 38,
- EDESTADDRREQ = 39,
- EMSGSIZE = 40,
- EPROTOTYPE = 41,
- ENOPROTOOPT = 42,
- EPROTONOSUPPORT = 43,
- ESOCKTNOSUPPORT = 44,
- EOPNOTSUPP = 45,
- EPFNOSUPPORT = 46,
- EAFNOSUPPORT = 47,
- EADDRINUSE = 48,
- EADDRNOTAVAIL = 49,
- ENETDOWN = 50,
- ENETUNREACH = 51,
- ENETRESET = 52,
- ECONNABORTED = 53,
- ECONNRESET = 54,
- ENOBUFS = 55,
- EISCONN = 56,
- ENOTCONN = 57,
- ESHUTDOWN = 58,
- ETOOMANYREFS = 59,
- ETIMEDOUT = 60,
- ECONNREFUSED = 61,
- ELOOP = 62,
- ENAMETOOLONG = 63,
- EHOSTDOWN = 64,
- EHOSTUNREACH = 65,
- ENOTEMPTY = 66,
- EPROCLIM = 67,
- EUSERS = 68,
- EDQUOT = 69,
- ESTALE = 70,
- EREMOTE = 71,
- EBADRPC = 72,
- ERPCMISMATCH = 73,
- EPROGUNAVAIL = 74,
- EPROGMISMATCH = 75,
- EPROCUNAVAIL = 76,
- ENOLCK = 77,
- ENOSYS = 78,
- EFTYPE = 79,
- EAUTH = 80,
- ENEEDAUTH = 81,
- EIPSEC = 82,
- ENOATTR = 83,
- EILSEQ = 84,
- ENOMEDIUM = 85,
- EMEDIUMTYPE = 86,
- EOVERFLOW = 87,
- ECANCELED = 88,
- EIDRM = 89,
- ENOMSG = 90,
- ENOTSUP = 91,
+ EPERM = libc::EPERM,
+ ENOENT = libc::ENOENT,
+ ESRCH = libc::ESRCH,
+ EINTR = libc::EINTR,
+ EIO = libc::EIO,
+ ENXIO = libc::ENXIO,
+ E2BIG = libc::E2BIG,
+ ENOEXEC = libc::ENOEXEC,
+ EBADF = libc::EBADF,
+ ECHILD = libc::ECHILD,
+ EDEADLK = libc::EDEADLK,
+ ENOMEM = libc::ENOMEM,
+ EACCES = libc::EACCES,
+ EFAULT = libc::EFAULT,
+ ENOTBLK = libc::ENOTBLK,
+ EBUSY = libc::EBUSY,
+ EEXIST = libc::EEXIST,
+ EXDEV = libc::EXDEV,
+ ENODEV = libc::ENODEV,
+ ENOTDIR = libc::ENOTDIR,
+ EISDIR = libc::EISDIR,
+ EINVAL = libc::EINVAL,
+ ENFILE = libc::ENFILE,
+ EMFILE = libc::EMFILE,
+ ENOTTY = libc::ENOTTY,
+ ETXTBSY = libc::ETXTBSY,
+ EFBIG = libc::EFBIG,
+ ENOSPC = libc::ENOSPC,
+ ESPIPE = libc::ESPIPE,
+ EROFS = libc::EROFS,
+ EMLINK = libc::EMLINK,
+ EPIPE = libc::EPIPE,
+ EDOM = libc::EDOM,
+ ERANGE = libc::ERANGE,
+ EAGAIN = libc::EAGAIN,
+ EINPROGRESS = libc::EINPROGRESS,
+ EALREADY = libc::EALREADY,
+ ENOTSOCK = libc::ENOTSOCK,
+ EDESTADDRREQ = libc::EDESTADDRREQ,
+ EMSGSIZE = libc::EMSGSIZE,
+ EPROTOTYPE = libc::EPROTOTYPE,
+ ENOPROTOOPT = libc::ENOPROTOOPT,
+ EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
+ ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT,
+ EOPNOTSUPP = libc::EOPNOTSUPP,
+ EPFNOSUPPORT = libc::EPFNOSUPPORT,
+ EAFNOSUPPORT = libc::EAFNOSUPPORT,
+ EADDRINUSE = libc::EADDRINUSE,
+ EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
+ ENETDOWN = libc::ENETDOWN,
+ ENETUNREACH = libc::ENETUNREACH,
+ ENETRESET = libc::ENETRESET,
+ ECONNABORTED = libc::ECONNABORTED,
+ ECONNRESET = libc::ECONNRESET,
+ ENOBUFS = libc::ENOBUFS,
+ EISCONN = libc::EISCONN,
+ ENOTCONN = libc::ENOTCONN,
+ ESHUTDOWN = libc::ESHUTDOWN,
+ ETOOMANYREFS = libc::ETOOMANYREFS,
+ ETIMEDOUT = libc::ETIMEDOUT,
+ ECONNREFUSED = libc::ECONNREFUSED,
+ ELOOP = libc::ELOOP,
+ ENAMETOOLONG = libc::ENAMETOOLONG,
+ EHOSTDOWN = libc::EHOSTDOWN,
+ EHOSTUNREACH = libc::EHOSTUNREACH,
+ ENOTEMPTY = libc::ENOTEMPTY,
+ EPROCLIM = libc::EPROCLIM,
+ EUSERS = libc::EUSERS,
+ EDQUOT = libc::EDQUOT,
+ ESTALE = libc::ESTALE,
+ EREMOTE = libc::EREMOTE,
+ EBADRPC = libc::EBADRPC,
+ ERPCMISMATCH = libc::ERPCMISMATCH,
+ EPROGUNAVAIL = libc::EPROGUNAVAIL,
+ EPROGMISMATCH = libc::EPROGMISMATCH,
+ EPROCUNAVAIL = libc::EPROCUNAVAIL,
+ ENOLCK = libc::ENOLCK,
+ ENOSYS = libc::ENOSYS,
+ EFTYPE = libc::EFTYPE,
+ EAUTH = libc::EAUTH,
+ ENEEDAUTH = libc::ENEEDAUTH,
+ EIPSEC = libc::EIPSEC,
+ ENOATTR = libc::ENOATTR,
+ EILSEQ = libc::EILSEQ,
+ ENOMEDIUM = libc::ENOMEDIUM,
+ EMEDIUMTYPE = libc::EMEDIUMTYPE,
+ EOVERFLOW = libc::EOVERFLOW,
+ ECANCELED = libc::ECANCELED,
+ EIDRM = libc::EIDRM,
+ ENOMSG = libc::ENOMSG,
+ ENOTSUP = libc::ENOTSUP,
}
pub const ELAST: Errno = Errno::ENOTSUP;
@@ -1598,98 +1607,98 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
- 1 => EPERM,
- 2 => ENOENT,
- 3 => ESRCH,
- 4 => EINTR,
- 5 => EIO,
- 6 => ENXIO,
- 7 => E2BIG,
- 8 => ENOEXEC,
- 9 => EBADF,
- 10 => ECHILD,
- 11 => EDEADLK,
- 12 => ENOMEM,
- 13 => EACCES,
- 14 => EFAULT,
- 15 => ENOTBLK,
- 16 => EBUSY,
- 17 => EEXIST,
- 18 => EXDEV,
- 19 => ENODEV,
- 20 => ENOTDIR,
- 21 => EISDIR,
- 22 => EINVAL,
- 23 => ENFILE,
- 24 => EMFILE,
- 25 => ENOTTY,
- 26 => ETXTBSY,
- 27 => EFBIG,
- 28 => ENOSPC,
- 29 => ESPIPE,
- 30 => EROFS,
- 31 => EMLINK,
- 32 => EPIPE,
- 33 => EDOM,
- 34 => ERANGE,
- 35 => EAGAIN,
- 36 => EINPROGRESS,
- 37 => EALREADY,
- 38 => ENOTSOCK,
- 39 => EDESTADDRREQ,
- 40 => EMSGSIZE,
- 41 => EPROTOTYPE,
- 42 => ENOPROTOOPT,
- 43 => EPROTONOSUPPORT,
- 44 => ESOCKTNOSUPPORT,
- 45 => EOPNOTSUPP,
- 46 => EPFNOSUPPORT,
- 47 => EAFNOSUPPORT,
- 48 => EADDRINUSE,
- 49 => EADDRNOTAVAIL,
- 50 => ENETDOWN,
- 51 => ENETUNREACH,
- 52 => ENETRESET,
- 53 => ECONNABORTED,
- 54 => ECONNRESET,
- 55 => ENOBUFS,
- 56 => EISCONN,
- 57 => ENOTCONN,
- 58 => ESHUTDOWN,
- 59 => ETOOMANYREFS,
- 60 => ETIMEDOUT,
- 61 => ECONNREFUSED,
- 62 => ELOOP,
- 63 => ENAMETOOLONG,
- 64 => EHOSTDOWN,
- 65 => EHOSTUNREACH,
- 66 => ENOTEMPTY,
- 67 => EPROCLIM,
- 68 => EUSERS,
- 69 => EDQUOT,
- 70 => ESTALE,
- 71 => EREMOTE,
- 72 => EBADRPC,
- 73 => ERPCMISMATCH,
- 74 => EPROGUNAVAIL,
- 75 => EPROGMISMATCH,
- 76 => EPROCUNAVAIL,
- 77 => ENOLCK,
- 78 => ENOSYS,
- 79 => EFTYPE,
- 80 => EAUTH,
- 81 => ENEEDAUTH,
- 82 => EIPSEC,
- 83 => ENOATTR,
- 84 => EILSEQ,
- 85 => ENOMEDIUM,
- 86 => EMEDIUMTYPE,
- 87 => EOVERFLOW,
- 88 => ECANCELED,
- 89 => EIDRM,
- 90 => ENOMSG,
- 91 => ENOTSUP,
+ 0 => UnknownErrno,
+ libc::EPERM => EPERM,
+ libc::ENOENT => ENOENT,
+ libc::ESRCH => ESRCH,
+ libc::EINTR => EINTR,
+ libc::EIO => EIO,
+ libc::ENXIO => ENXIO,
+ libc::E2BIG => E2BIG,
+ libc::ENOEXEC => ENOEXEC,
+ libc::EBADF => EBADF,
+ libc::ECHILD => ECHILD,
+ libc::EDEADLK => EDEADLK,
+ libc::ENOMEM => ENOMEM,
+ libc::EACCES => EACCES,
+ libc::EFAULT => EFAULT,
+ libc::ENOTBLK => ENOTBLK,
+ libc::EBUSY => EBUSY,
+ libc::EEXIST => EEXIST,
+ libc::EXDEV => EXDEV,
+ libc::ENODEV => ENODEV,
+ libc::ENOTDIR => ENOTDIR,
+ libc::EISDIR => EISDIR,
+ libc::EINVAL => EINVAL,
+ libc::ENFILE => ENFILE,
+ libc::EMFILE => EMFILE,
+ libc::ENOTTY => ENOTTY,
+ libc::ETXTBSY => ETXTBSY,
+ libc::EFBIG => EFBIG,
+ libc::ENOSPC => ENOSPC,
+ libc::ESPIPE => ESPIPE,
+ libc::EROFS => EROFS,
+ libc::EMLINK => EMLINK,
+ libc::EPIPE => EPIPE,
+ libc::EDOM => EDOM,
+ libc::ERANGE => ERANGE,
+ libc::EAGAIN => EAGAIN,
+ libc::EINPROGRESS => EINPROGRESS,
+ libc::EALREADY => EALREADY,
+ libc::ENOTSOCK => ENOTSOCK,
+ libc::EDESTADDRREQ => EDESTADDRREQ,
+ libc::EMSGSIZE => EMSGSIZE,
+ libc::EPROTOTYPE => EPROTOTYPE,
+ libc::ENOPROTOOPT => ENOPROTOOPT,
+ libc::EPROTONOSUPPORT => EPROTONOSUPPORT,
+ libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT,
+ libc::EOPNOTSUPP => EOPNOTSUPP,
+ libc::EPFNOSUPPORT => EPFNOSUPPORT,
+ libc::EAFNOSUPPORT => EAFNOSUPPORT,
+ libc::EADDRINUSE => EADDRINUSE,
+ libc::EADDRNOTAVAIL => EADDRNOTAVAIL,
+ libc::ENETDOWN => ENETDOWN,
+ libc::ENETUNREACH => ENETUNREACH,
+ libc::ENETRESET => ENETRESET,
+ libc::ECONNABORTED => ECONNABORTED,
+ libc::ECONNRESET => ECONNRESET,
+ libc::ENOBUFS => ENOBUFS,
+ libc::EISCONN => EISCONN,
+ libc::ENOTCONN => ENOTCONN,
+ libc::ESHUTDOWN => ESHUTDOWN,
+ libc::ETOOMANYREFS => ETOOMANYREFS,
+ libc::ETIMEDOUT => ETIMEDOUT,
+ libc::ECONNREFUSED => ECONNREFUSED,
+ libc::ELOOP => ELOOP,
+ libc::ENAMETOOLONG => ENAMETOOLONG,
+ libc::EHOSTDOWN => EHOSTDOWN,
+ libc::EHOSTUNREACH => EHOSTUNREACH,
+ libc::ENOTEMPTY => ENOTEMPTY,
+ libc::EPROCLIM => EPROCLIM,
+ libc::EUSERS => EUSERS,
+ libc::EDQUOT => EDQUOT,
+ libc::ESTALE => ESTALE,
+ libc::EREMOTE => EREMOTE,
+ libc::EBADRPC => EBADRPC,
+ libc::ERPCMISMATCH => ERPCMISMATCH,
+ libc::EPROGUNAVAIL => EPROGUNAVAIL,
+ libc::EPROGMISMATCH => EPROGMISMATCH,
+ libc::EPROCUNAVAIL => EPROCUNAVAIL,
+ libc::ENOLCK => ENOLCK,
+ libc::ENOSYS => ENOSYS,
+ libc::EFTYPE => EFTYPE,
+ libc::EAUTH => EAUTH,
+ libc::ENEEDAUTH => ENEEDAUTH,
+ libc::EIPSEC => EIPSEC,
+ libc::ENOATTR => ENOATTR,
+ libc::EILSEQ => EILSEQ,
+ libc::ENOMEDIUM => ENOMEDIUM,
+ libc::EMEDIUMTYPE => EMEDIUMTYPE,
+ libc::EOVERFLOW => EOVERFLOW,
+ libc::ECANCELED => ECANCELED,
+ libc::EIDRM => EIDRM,
+ libc::ENOMSG => ENOMSG,
+ libc::ENOTSUP => ENOTSUP,
_ => UnknownErrno,
}
}
@@ -1697,105 +1706,108 @@ mod consts {
#[cfg(target_os = "netbsd")]
mod consts {
- #[derive(Copy, Debug, Clone, PartialEq)]
+ use libc;
+
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ #[repr(i32)]
pub enum Errno {
UnknownErrno = 0,
- EPERM = 1,
- ENOENT = 2,
- ESRCH = 3,
- EINTR = 4,
- EIO = 5,
- ENXIO = 6,
- E2BIG = 7,
- ENOEXEC = 8,
- EBADF = 9,
- ECHILD = 10,
- EDEADLK = 11,
- ENOMEM = 12,
- EACCES = 13,
- EFAULT = 14,
- ENOTBLK = 15,
- EBUSY = 16,
- EEXIST = 17,
- EXDEV = 18,
- ENODEV = 19,
- ENOTDIR = 20,
- EISDIR = 21,
- EINVAL = 22,
- ENFILE = 23,
- EMFILE = 24,
- ENOTTY = 25,
- ETXTBSY = 26,
- EFBIG = 27,
- ENOSPC = 28,
- ESPIPE = 29,
- EROFS = 30,
- EMLINK = 31,
- EPIPE = 32,
- EDOM = 33,
- ERANGE = 34,
- EAGAIN = 35,
- EINPROGRESS = 36,
- EALREADY = 37,
- ENOTSOCK = 38,
- EDESTADDRREQ = 39,
- EMSGSIZE = 40,
- EPROTOTYPE = 41,
- ENOPROTOOPT = 42,
- EPROTONOSUPPORT = 43,
- ESOCKTNOSUPPORT = 44,
- EOPNOTSUPP = 45,
- EPFNOSUPPORT = 46,
- EAFNOSUPPORT = 47,
- EADDRINUSE = 48,
- EADDRNOTAVAIL = 49,
- ENETDOWN = 50,
- ENETUNREACH = 51,
- ENETRESET = 52,
- ECONNABORTED = 53,
- ECONNRESET = 54,
- ENOBUFS = 55,
- EISCONN = 56,
- ENOTCONN = 57,
- ESHUTDOWN = 58,
- ETOOMANYREFS = 59,
- ETIMEDOUT = 60,
- ECONNREFUSED = 61,
- ELOOP = 62,
- ENAMETOOLONG = 63,
- EHOSTDOWN = 64,
- EHOSTUNREACH = 65,
- ENOTEMPTY = 66,
- EPROCLIM = 67,
- EUSERS = 68,
- EDQUOT = 69,
- ESTALE = 70,
- EREMOTE = 71,
- EBADRPC = 72,
- ERPCMISMATCH = 73,
- EPROGUNAVAIL = 74,
- EPROGMISMATCH = 75,
- EPROCUNAVAIL = 76,
- ENOLCK = 77,
- ENOSYS = 78,
- EFTYPE = 79,
- EAUTH = 80,
- ENEEDAUTH = 81,
- EIDRM = 82,
- ENOMSG = 83,
- EOVERFLOW = 84,
- EILSEQ = 85,
- ENOTSUP = 86,
- ECANCELED = 87,
- EBADMSG = 88,
- ENODATA = 89,
- ENOSR = 90,
- ENOSTR = 91,
- ETIME = 92,
- ENOATTR = 93,
- EMULTIHOP = 94,
- ENOLINK = 95,
- EPROTO = 96,
+ EPERM = libc::EPERM,
+ ENOENT = libc::ENOENT,
+ ESRCH = libc::ESRCH,
+ EINTR = libc::EINTR,
+ EIO = libc::EIO,
+ ENXIO = libc::ENXIO,
+ E2BIG = libc::E2BIG,
+ ENOEXEC = libc::ENOEXEC,
+ EBADF = libc::EBADF,
+ ECHILD = libc::ECHILD,
+ EDEADLK = libc::EDEADLK,
+ ENOMEM = libc::ENOMEM,
+ EACCES = libc::EACCES,
+ EFAULT = libc::EFAULT,
+ ENOTBLK = libc::ENOTBLK,
+ EBUSY = libc::EBUSY,
+ EEXIST = libc::EEXIST,
+ EXDEV = libc::EXDEV,
+ ENODEV = libc::ENODEV,
+ ENOTDIR = libc::ENOTDIR,
+ EISDIR = libc::EISDIR,
+ EINVAL = libc::EINVAL,
+ ENFILE = libc::ENFILE,
+ EMFILE = libc::EMFILE,
+ ENOTTY = libc::ENOTTY,
+ ETXTBSY = libc::ETXTBSY,
+ EFBIG = libc::EFBIG,
+ ENOSPC = libc::ENOSPC,
+ ESPIPE = libc::ESPIPE,
+ EROFS = libc::EROFS,
+ EMLINK = libc::EMLINK,
+ EPIPE = libc::EPIPE,
+ EDOM = libc::EDOM,
+ ERANGE = libc::ERANGE,
+ EAGAIN = libc::EAGAIN,
+ EINPROGRESS = libc::EINPROGRESS,
+ EALREADY = libc::EALREADY,
+ ENOTSOCK = libc::ENOTSOCK,
+ EDESTADDRREQ = libc::EDESTADDRREQ,
+ EMSGSIZE = libc::EMSGSIZE,
+ EPROTOTYPE = libc::EPROTOTYPE,
+ ENOPROTOOPT = libc::ENOPROTOOPT,
+ EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
+ ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT,
+ EOPNOTSUPP = libc::EOPNOTSUPP,
+ EPFNOSUPPORT = libc::EPFNOSUPPORT,
+ EAFNOSUPPORT = libc::EAFNOSUPPORT,
+ EADDRINUSE = libc::EADDRINUSE,
+ EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
+ ENETDOWN = libc::ENETDOWN,
+ ENETUNREACH = libc::ENETUNREACH,
+ ENETRESET = libc::ENETRESET,
+ ECONNABORTED = libc::ECONNABORTED,
+ ECONNRESET = libc::ECONNRESET,
+ ENOBUFS = libc::ENOBUFS,
+ EISCONN = libc::EISCONN,
+ ENOTCONN = libc::ENOTCONN,
+ ESHUTDOWN = libc::ESHUTDOWN,
+ ETOOMANYREFS = libc::ETOOMANYREFS,
+ ETIMEDOUT = libc::ETIMEDOUT,
+ ECONNREFUSED = libc::ECONNREFUSED,
+ ELOOP = libc::ELOOP,
+ ENAMETOOLONG = libc::ENAMETOOLONG,
+ EHOSTDOWN = libc::EHOSTDOWN,
+ EHOSTUNREACH = libc::EHOSTUNREACH,
+ ENOTEMPTY = libc::ENOTEMPTY,
+ EPROCLIM = libc::EPROCLIM,
+ EUSERS = libc::EUSERS,
+ EDQUOT = libc::EDQUOT,
+ ESTALE = libc::ESTALE,
+ EREMOTE = libc::EREMOTE,
+ EBADRPC = libc::EBADRPC,
+ ERPCMISMATCH = libc::ERPCMISMATCH,
+ EPROGUNAVAIL = libc::EPROGUNAVAIL,
+ EPROGMISMATCH = libc::EPROGMISMATCH,
+ EPROCUNAVAIL = libc::EPROCUNAVAIL,
+ ENOLCK = libc::ENOLCK,
+ ENOSYS = libc::ENOSYS,
+ EFTYPE = libc::EFTYPE,
+ EAUTH = libc::EAUTH,
+ ENEEDAUTH = libc::ENEEDAUTH,
+ EIDRM = libc::EIDRM,
+ ENOMSG = libc::ENOMSG,
+ EOVERFLOW = libc::EOVERFLOW,
+ EILSEQ = libc::EILSEQ,
+ ENOTSUP = libc::ENOTSUP,
+ ECANCELED = libc::ECANCELED,
+ EBADMSG = libc::EBADMSG,
+ ENODATA = libc::ENODATA,
+ ENOSR = libc::ENOSR,
+ ENOSTR = libc::ENOSTR,
+ ETIME = libc::ETIME,
+ ENOATTR = libc::ENOATTR,
+ EMULTIHOP = libc::EMULTIHOP,
+ ENOLINK = libc::ENOLINK,
+ EPROTO = libc::EPROTO,
}
pub const ELAST: Errno = Errno::ENOTSUP;
@@ -1807,424 +1819,104 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
- 1 => EPERM,
- 2 => ENOENT,
- 3 => ESRCH,
- 4 => EINTR,
- 5 => EIO,
- 6 => ENXIO,
- 7 => E2BIG,
- 8 => ENOEXEC,
- 9 => EBADF,
- 10 => ECHILD,
- 11 => EDEADLK,
- 12 => ENOMEM,
- 13 => EACCES,
- 14 => EFAULT,
- 15 => ENOTBLK,
- 16 => EBUSY,
- 17 => EEXIST,
- 18 => EXDEV,
- 19 => ENODEV,
- 20 => ENOTDIR,
- 21 => EISDIR,
- 22 => EINVAL,
- 23 => ENFILE,
- 24 => EMFILE,
- 25 => ENOTTY,
- 26 => ETXTBSY,
- 27 => EFBIG,
- 28 => ENOSPC,
- 29 => ESPIPE,
- 30 => EROFS,
- 31 => EMLINK,
- 32 => EPIPE,
- 33 => EDOM,
- 34 => ERANGE,
- 35 => EAGAIN,
- 36 => EINPROGRESS,
- 37 => EALREADY,
- 38 => ENOTSOCK,
- 39 => EDESTADDRREQ,
- 40 => EMSGSIZE,
- 41 => EPROTOTYPE,
- 42 => ENOPROTOOPT,
- 43 => EPROTONOSUPPORT,
- 44 => ESOCKTNOSUPPORT,
- 45 => EOPNOTSUPP,
- 46 => EPFNOSUPPORT,
- 47 => EAFNOSUPPORT,
- 48 => EADDRINUSE,
- 49 => EADDRNOTAVAIL,
- 50 => ENETDOWN,
- 51 => ENETUNREACH,
- 52 => ENETRESET,
- 53 => ECONNABORTED,
- 54 => ECONNRESET,
- 55 => ENOBUFS,
- 56 => EISCONN,
- 57 => ENOTCONN,
- 58 => ESHUTDOWN,
- 59 => ETOOMANYREFS,
- 60 => ETIMEDOUT,
- 61 => ECONNREFUSED,
- 62 => ELOOP,
- 63 => ENAMETOOLONG,
- 64 => EHOSTDOWN,
- 65 => EHOSTUNREACH,
- 66 => ENOTEMPTY,
- 67 => EPROCLIM,
- 68 => EUSERS,
- 69 => EDQUOT,
- 70 => ESTALE,
- 71 => EREMOTE,
- 72 => EBADRPC,
- 73 => ERPCMISMATCH,
- 74 => EPROGUNAVAIL,
- 75 => EPROGMISMATCH,
- 76 => EPROCUNAVAIL,
- 77 => ENOLCK,
- 78 => ENOSYS,
- 79 => EFTYPE,
- 80 => EAUTH,
- 81 => ENEEDAUTH,
- 82 => EIDRM,
- 83 => ENOMSG,
- 84 => EOVERFLOW,
- 85 => EILSEQ,
- 86 => ENOTSUP,
- 87 => ECANCELED,
- 88 => EBADMSG,
- 89 => ENODATA,
- 90 => ENOSR,
- 91 => ENOSTR,
- 92 => ETIME,
- 93 => ENOATTR,
- 94 => EMULTIHOP,
- 95 => ENOLINK,
- 96 => EPROTO,
+ 0 => UnknownErrno,
+ libc::EPERM => EPERM,
+ libc::ENOENT => ENOENT,
+ libc::ESRCH => ESRCH,
+ libc::EINTR => EINTR,
+ libc::EIO => EIO,
+ libc::ENXIO => ENXIO,
+ libc::E2BIG => E2BIG,
+ libc::ENOEXEC => ENOEXEC,
+ libc::EBADF => EBADF,
+ libc::ECHILD => ECHILD,
+ libc::EDEADLK => EDEADLK,
+ libc::ENOMEM => ENOMEM,
+ libc::EACCES => EACCES,
+ libc::EFAULT => EFAULT,
+ libc::ENOTBLK => ENOTBLK,
+ libc::EBUSY => EBUSY,
+ libc::EEXIST => EEXIST,
+ libc::EXDEV => EXDEV,
+ libc::ENODEV => ENODEV,
+ libc::ENOTDIR => ENOTDIR,
+ libc::EISDIR => EISDIR,
+ libc::EINVAL => EINVAL,
+ libc::ENFILE => ENFILE,
+ libc::EMFILE => EMFILE,
+ libc::ENOTTY => ENOTTY,
+ libc::ETXTBSY => ETXTBSY,
+ libc::EFBIG => EFBIG,
+ libc::ENOSPC => ENOSPC,
+ libc::ESPIPE => ESPIPE,
+ libc::EROFS => EROFS,
+ libc::EMLINK => EMLINK,
+ libc::EPIPE => EPIPE,
+ libc::EDOM => EDOM,
+ libc::ERANGE => ERANGE,
+ libc::EAGAIN => EAGAIN,
+ libc::EINPROGRESS => EINPROGRESS,
+ libc::EALREADY => EALREADY,
+ libc::ENOTSOCK => ENOTSOCK,
+ libc::EDESTADDRREQ => EDESTADDRREQ,
+ libc::EMSGSIZE => EMSGSIZE,
+ libc::EPROTOTYPE => EPROTOTYPE,
+ libc::ENOPROTOOPT => ENOPROTOOPT,
+ libc::EPROTONOSUPPORT => EPROTONOSUPPORT,
+ libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT,
+ libc::EOPNOTSUPP => EOPNOTSUPP,
+ libc::EPFNOSUPPORT => EPFNOSUPPORT,
+ libc::EAFNOSUPPORT => EAFNOSUPPORT,
+ libc::EADDRINUSE => EADDRINUSE,
+ libc::EADDRNOTAVAIL => EADDRNOTAVAIL,
+ libc::ENETDOWN => ENETDOWN,
+ libc::ENETUNREACH => ENETUNREACH,
+ libc::ENETRESET => ENETRESET,
+ libc::ECONNABORTED => ECONNABORTED,
+ libc::ECONNRESET => ECONNRESET,
+ libc::ENOBUFS => ENOBUFS,
+ libc::EISCONN => EISCONN,
+ libc::ENOTCONN => ENOTCONN,
+ libc::ESHUTDOWN => ESHUTDOWN,
+ libc::ETOOMANYREFS => ETOOMANYREFS,
+ libc::ETIMEDOUT => ETIMEDOUT,
+ libc::ECONNREFUSED => ECONNREFUSED,
+ libc::ELOOP => ELOOP,
+ libc::ENAMETOOLONG => ENAMETOOLONG,
+ libc::EHOSTDOWN => EHOSTDOWN,
+ libc::EHOSTUNREACH => EHOSTUNREACH,
+ libc::ENOTEMPTY => ENOTEMPTY,
+ libc::EPROCLIM => EPROCLIM,
+ libc::EUSERS => EUSERS,
+ libc::EDQUOT => EDQUOT,
+ libc::ESTALE => ESTALE,
+ libc::EREMOTE => EREMOTE,
+ libc::EBADRPC => EBADRPC,
+ libc::ERPCMISMATCH => ERPCMISMATCH,
+ libc::EPROGUNAVAIL => EPROGUNAVAIL,
+ libc::EPROGMISMATCH => EPROGMISMATCH,
+ libc::EPROCUNAVAIL => EPROCUNAVAIL,
+ libc::ENOLCK => ENOLCK,
+ libc::ENOSYS => ENOSYS,
+ libc::EFTYPE => EFTYPE,
+ libc::EAUTH => EAUTH,
+ libc::ENEEDAUTH => ENEEDAUTH,
+ libc::EIDRM => EIDRM,
+ libc::ENOMSG => ENOMSG,
+ libc::EOVERFLOW => EOVERFLOW,
+ libc::EILSEQ => EILSEQ,
+ libc::ENOTSUP => ENOTSUP,
+ libc::ECANCELED => ECANCELED,
+ libc::EBADMSG => EBADMSG,
+ libc::ENODATA => ENODATA,
+ libc::ENOSR => ENOSR,
+ libc::ENOSTR => ENOSTR,
+ libc::ETIME => ETIME,
+ libc::ENOATTR => ENOATTR,
+ libc::EMULTIHOP => EMULTIHOP,
+ libc::ENOLINK => ENOLINK,
+ libc::EPROTO => EPROTO,
_ => UnknownErrno,
}
}
}
-
-
-#[cfg(test)]
-mod test {
- use super::Errno::*;
- use nixtest::assert_const_eq;
- use libc::c_int;
-
- macro_rules! check_errno {
- ($($errno:ident),+) => {{
- $(assert_const_eq(stringify!($errno), $errno as c_int);)+
- }};
- }
-
- #[test]
- pub fn test_errno_values() {
- check_errno!(
- EPERM,
- ENOENT,
- ESRCH,
- EINTR,
- EIO,
- ENXIO,
- E2BIG,
- ENOEXEC,
- EBADF,
- ECHILD,
- EAGAIN,
- ENOMEM,
- EACCES,
- EFAULT,
- ENOTBLK,
- EBUSY,
- EEXIST,
- EXDEV,
- ENODEV,
- ENOTDIR,
- EISDIR,
- EINVAL,
- ENFILE,
- EMFILE,
- ENOTTY,
- ETXTBSY,
- EFBIG,
- ENOSPC,
- ESPIPE,
- EROFS,
- EMLINK,
- EPIPE,
- EDOM,
- ERANGE,
- EDEADLK,
- ENAMETOOLONG,
- ENOLCK,
- ENOSYS,
- ENOTEMPTY,
- ELOOP,
- ENOMSG,
- EIDRM);
-
- check_errno!(
- EINPROGRESS,
- EALREADY,
- ENOTSOCK,
- EDESTADDRREQ,
- EMSGSIZE,
- EPROTOTYPE,
- ENOPROTOOPT,
- EPROTONOSUPPORT,
- ESOCKTNOSUPPORT,
- EPFNOSUPPORT,
- EAFNOSUPPORT,
- EADDRINUSE,
- EADDRNOTAVAIL,
- ENETDOWN,
- ENETUNREACH,
- ENETRESET,
- ECONNABORTED,
- ECONNRESET,
- ENOBUFS,
- EISCONN,
- ENOTCONN,
- ESHUTDOWN,
- ETOOMANYREFS,
- ETIMEDOUT,
- ECONNREFUSED,
- EHOSTDOWN,
- EHOSTUNREACH);
- }
-
- #[test]
- #[cfg(any(target_os = "linux", target_os = "android"))]
- pub fn test_linux_errnos() {
- check_errno!(
- ECHRNG,
- EL2NSYNC,
- EL3HLT,
- EL3RST,
- ELNRNG,
- EUNATCH,
- ENOCSI,
- EL2HLT,
- EBADE,
- EBADR,
- EXFULL,
- ENOANO,
- EBADRQC,
- EBADSLT,
- EBFONT,
- ENOSTR,
- ENODATA,
- ETIME,
- ENOSR,
- ENONET,
- ENOPKG,
- EREMOTE,
- ENOLINK,
- EADV,
- ESRMNT,
- ECOMM,
- EPROTO,
- EMULTIHOP,
- EDOTDOT,
- EBADMSG,
- EOVERFLOW,
- ENOTUNIQ,
- EBADFD,
- EREMCHG,
- ELIBACC,
- ELIBBAD,
- ELIBSCN,
- ELIBMAX,
- ELIBEXEC,
- EILSEQ,
- ERESTART,
- ESTRPIPE,
- EUSERS,
- EOPNOTSUPP,
- ESTALE,
- EUCLEAN,
- ENOTNAM,
- ENAVAIL,
- EISNAM,
- EREMOTEIO,
- EDQUOT,
- ENOMEDIUM,
- EMEDIUMTYPE,
- ECANCELED,
- ENOKEY,
- EKEYEXPIRED,
- EKEYREVOKED,
- EKEYREJECTED,
- EOWNERDEAD,
- ENOTRECOVERABLE);
- }
-
- #[test]
- #[cfg(all(target_os = "linux", not(target_arch = "mips")))]
- pub fn test_linux_not_android_errnos() {
- check_errno!(
- ERFKILL /*,
- EHWPOISON */);
- }
-
- #[test]
- #[cfg(target_os = "freebsd")]
- pub fn test_freebsd_errnos() {
- check_errno!(
- EDOOFUS,
- EMULTIHOP,
- ENOLINK,
- ENOTCAPABLE,
- ECAPMODE,
- ENEEDAUTH,
- EOVERFLOW,
- EILSEQ,
- ENOATTR,
- EBADMSG,
- EPROTO,
- ENOTRECOVERABLE,
- EOWNERDEAD,
- ENOTSUP,
- EPROCLIM,
- EUSERS,
- EDQUOT,
- ESTALE,
- EREMOTE,
- EBADRPC,
- ERPCMISMATCH,
- EPROGUNAVAIL,
- EPROGMISMATCH,
- EPROCUNAVAIL,
- EAUTH);
- }
-
- #[test]
- #[cfg(target_os = "dragonfly")]
- pub fn test_dragonfly_errnos() {
- check_errno!(
- EDOOFUS,
- EMULTIHOP,
- ENOLINK,
- ENEEDAUTH,
- EOVERFLOW,
- EILSEQ,
- ENOATTR,
- EBADMSG,
- EPROTO,
- ENOTSUP,
- EPROCLIM,
- EUSERS,
- EDQUOT,
- ESTALE,
- EREMOTE,
- EBADRPC,
- ERPCMISMATCH,
- EPROGUNAVAIL,
- EPROGMISMATCH,
- EPROCUNAVAIL,
- EAUTH);
- }
-
- #[test]
- #[cfg(target_os = "openbsd")]
- pub fn test_openbsd_errnos() {
- check_errno!(
- EADDRINUSE,
- EADDRNOTAVAIL,
- EAFNOSUPPORT,
- EALREADY,
- EAUTH,
- EBADRPC,
- ECANCELED,
- ECONNABORTED,
- ECONNREFUSED,
- ECONNRESET,
- EDESTADDRREQ,
- EDQUOT,
- EFTYPE,
- EHOSTDOWN,
- EHOSTUNREACH,
- EILSEQ,
- EINPROGRESS,
- EIPSEC,
- EISCONN,
- EMEDIUMTYPE,
- EMSGSIZE,
- ENEEDAUTH,
- ENETDOWN,
- ENETRESET,
- ENETUNREACH,
- ENOATTR,
- ENOBUFS,
- ENOMEDIUM,
- ENOPROTOOPT,
- ENOTCONN,
- ENOTSOCK,
- ENOTSUP,
- EOPNOTSUPP,
- EOVERFLOW,
- EPFNOSUPPORT,
- EPROCLIM,
- EPROCUNAVAIL,
- EPROGMISMATCH,
- EPROGUNAVAIL,
- EPROTONOSUPPORT,
- EPROTOTYPE,
- EREMOTE,
- ESHUTDOWN,
- ESOCKTNOSUPPORT,
- ESTALE,
- ETIMEDOUT,
- ETOOMANYREFS,
- EUSERS);
- }
-
- #[test]
- #[cfg(any(target_os = "macos", target_os = "ios"))]
- pub fn test_darwin_errnos() {
- check_errno!(
- ENOTSUP,
- EPROCLIM,
- EUSERS,
- EDQUOT,
- ESTALE,
- EREMOTE,
- EBADRPC,
- ERPCMISMATCH,
- EPROGUNAVAIL,
- EPROGMISMATCH,
- EPROCUNAVAIL,
- EFTYPE,
- EAUTH,
- ENEEDAUTH,
- EPWROFF,
- EDEVERR,
- EOVERFLOW,
- EBADEXEC,
- EBADARCH,
- ESHLIBVERS,
- EBADMACHO,
- ECANCELED,
- EILSEQ,
- ENOATTR,
- EBADMSG,
- EMULTIHOP,
- ENODATA,
- ENOLINK,
- ENOSR,
- ENOSTR,
- EPROTO,
- ETIME,
- EOPNOTSUPP,
- ENOPOLICY,
- ENOTRECOVERABLE,
- EOWNERDEAD,
- EQFULL
- );
- }
-}