diff options
author | Homu <homu@barosl.com> | 2017-04-16 06:11:28 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2017-04-16 06:11:28 +0900 |
commit | 635c8718eede6d7f6a50cf9954a9af8603d2fa1d (patch) | |
tree | 6faeff26b5dd177130a4dbac9020a53e8a7099ae /src/errno.rs | |
parent | 44c0ecbc42bc8f5ea132aa07cc612139a2cd74b0 (diff) | |
parent | 56f5a0a0068c6a7ba69d5b91bf05f664b6dfc1a4 (diff) | |
download | nix-635c8718eede6d7f6a50cf9954a9af8603d2fa1d.zip |
Auto merge of #536 - nix-rust:new-ci/master, r=kamalmarhubi
Merge New CI Infrastructure Based on Trust/Cross Into Master
See discussion on https://github.com/nix-rust/nix/pull/528. This PR is to track the final decision of whether we are ready to merge the new CI infrastructure (and related bug fixes) back into master. Initially, we know that the branch is not ready to merge (as there are still failing tests).
This PR acts as a single point of reference to get the current status of how close we are to merging things back into master. A number of issues with "TRUST CI" in the title have been created for the work that appears to be required to get us to the point where this branch can be merged.
Diffstat (limited to 'src/errno.rs')
-rw-r--r-- | src/errno.rs | 544 |
1 files changed, 273 insertions, 271 deletions
diff --git a/src/errno.rs b/src/errno.rs index 4218bf9c..a27abaa7 100644 --- a/src/errno.rs +++ b/src/errno.rs @@ -374,10 +374,10 @@ fn desc(errno: Errno) -> &'static str { #[cfg(any(target_os = "linux", target_os = "android"))] ENOTRECOVERABLE => "State not recoverable", - #[cfg(target_os = "linux")] + #[cfg(all(target_os = "linux", not(target_arch="mips")))] ERFKILL => "Operation not possible due to RF-kill", - #[cfg(target_os = "linux")] + #[cfg(all(target_os = "linux", not(target_arch="mips")))] EHWPOISON => "Memory page has hardware error", #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] @@ -522,143 +522,145 @@ fn desc(errno: Errno) -> &'static str { #[cfg(any(target_os = "linux", target_os = "android"))] mod consts { + use libc; + #[derive(Debug, Clone, PartialEq, Copy)] 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, - EAGAIN = 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, - EDEADLK = 35, - ENAMETOOLONG = 36, - ENOLCK = 37, - ENOSYS = 38, - ENOTEMPTY = 39, - ELOOP = 40, - ENOMSG = 42, - EIDRM = 43, - ECHRNG = 44, - EL2NSYNC = 45, - EL3HLT = 46, - EL3RST = 47, - ELNRNG = 48, - EUNATCH = 49, - ENOCSI = 50, - EL2HLT = 51, - EBADE = 52, - EBADR = 53, - EXFULL = 54, - ENOANO = 55, - EBADRQC = 56, - EBADSLT = 57, - EBFONT = 59, - ENOSTR = 60, - ENODATA = 61, - ETIME = 62, - ENOSR = 63, - ENONET = 64, - ENOPKG = 65, - EREMOTE = 66, - ENOLINK = 67, - EADV = 68, - ESRMNT = 69, - ECOMM = 70, - EPROTO = 71, - EMULTIHOP = 72, - EDOTDOT = 73, - EBADMSG = 74, - EOVERFLOW = 75, - ENOTUNIQ = 76, - EBADFD = 77, - EREMCHG = 78, - ELIBACC = 79, - ELIBBAD = 80, - ELIBSCN = 81, - ELIBMAX = 82, - ELIBEXEC = 83, - EILSEQ = 84, - ERESTART = 85, - ESTRPIPE = 86, - EUSERS = 87, - ENOTSOCK = 88, - EDESTADDRREQ = 89, - EMSGSIZE = 90, - EPROTOTYPE = 91, - ENOPROTOOPT = 92, - EPROTONOSUPPORT = 93, - ESOCKTNOSUPPORT = 94, - EOPNOTSUPP = 95, - EPFNOSUPPORT = 96, - EAFNOSUPPORT = 97, - EADDRINUSE = 98, - EADDRNOTAVAIL = 99, - ENETDOWN = 100, - ENETUNREACH = 101, - ENETRESET = 102, - ECONNABORTED = 103, - ECONNRESET = 104, - ENOBUFS = 105, - EISCONN = 106, - ENOTCONN = 107, - ESHUTDOWN = 108, - ETOOMANYREFS = 109, - ETIMEDOUT = 110, - ECONNREFUSED = 111, - EHOSTDOWN = 112, - EHOSTUNREACH = 113, - EALREADY = 114, - EINPROGRESS = 115, - ESTALE = 116, - EUCLEAN = 117, - ENOTNAM = 118, - ENAVAIL = 119, - EISNAM = 120, - EREMOTEIO = 121, - EDQUOT = 122, - ENOMEDIUM = 123, - EMEDIUMTYPE = 124, - ECANCELED = 125, - ENOKEY = 126, - EKEYEXPIRED = 127, - EKEYREVOKED = 128, - EKEYREJECTED = 129, - EOWNERDEAD = 130, - ENOTRECOVERABLE = 131, - - #[cfg(not(target_os = "android"))] - ERFKILL = 132, - #[cfg(not(target_os = "android"))] - EHWPOISON = 133, + 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, + + #[cfg(not(any(target_os = "android", target_arch="mips")))] + ERFKILL = libc::ERFKILL as isize, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + EHWPOISON = libc::EHWPOISON as isize, } pub const EWOULDBLOCK: Errno = Errno::EAGAIN; @@ -669,140 +671,140 @@ mod consts { 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 => EAGAIN, - 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 => EDEADLK, - 36 => ENAMETOOLONG, - 37 => ENOLCK, - 38 => ENOSYS, - 39 => ENOTEMPTY, - 40 => ELOOP, - 42 => ENOMSG, - 43 => EIDRM, - 44 => ECHRNG, - 45 => EL2NSYNC, - 46 => EL3HLT, - 47 => EL3RST, - 48 => ELNRNG, - 49 => EUNATCH, - 50 => ENOCSI, - 51 => EL2HLT, - 52 => EBADE, - 53 => EBADR, - 54 => EXFULL, - 55 => ENOANO, - 56 => EBADRQC, - 57 => EBADSLT, - 59 => EBFONT, - 60 => ENOSTR, - 61 => ENODATA, - 62 => ETIME, - 63 => ENOSR, - 64 => ENONET, - 65 => ENOPKG, - 66 => EREMOTE, - 67 => ENOLINK, - 68 => EADV, - 69 => ESRMNT, - 70 => ECOMM, - 71 => EPROTO, - 72 => EMULTIHOP, - 73 => EDOTDOT, - 74 => EBADMSG, - 75 => EOVERFLOW, - 76 => ENOTUNIQ, - 77 => EBADFD, - 78 => EREMCHG, - 79 => ELIBACC, - 80 => ELIBBAD, - 81 => ELIBSCN, - 82 => ELIBMAX, - 83 => ELIBEXEC, - 84 => EILSEQ, - 85 => ERESTART, - 86 => ESTRPIPE, - 87 => EUSERS, - 88 => ENOTSOCK, - 89 => EDESTADDRREQ, - 90 => EMSGSIZE, - 91 => EPROTOTYPE, - 92 => ENOPROTOOPT, - 93 => EPROTONOSUPPORT, - 94 => ESOCKTNOSUPPORT, - 95 => EOPNOTSUPP, - 96 => EPFNOSUPPORT, - 97 => EAFNOSUPPORT, - 98 => EADDRINUSE, - 99 => EADDRNOTAVAIL, - 100 => ENETDOWN, - 101 => ENETUNREACH, - 102 => ENETRESET, - 103 => ECONNABORTED, - 104 => ECONNRESET, - 105 => ENOBUFS, - 106 => EISCONN, - 107 => ENOTCONN, - 108 => ESHUTDOWN, - 109 => ETOOMANYREFS, - 110 => ETIMEDOUT, - 111 => ECONNREFUSED, - 112 => EHOSTDOWN, - 113 => EHOSTUNREACH, - 114 => EALREADY, - 115 => EINPROGRESS, - 116 => ESTALE, - 117 => EUCLEAN, - 118 => ENOTNAM, - 119 => ENAVAIL, - 120 => EISNAM, - 121 => EREMOTEIO, - 122 => EDQUOT, - 123 => ENOMEDIUM, - 124 => EMEDIUMTYPE, - 125 => ECANCELED, - 126 => ENOKEY, - 127 => EKEYEXPIRED, - 128 => EKEYREVOKED, - 129 => EKEYREJECTED, - 130 => EOWNERDEAD, - 131 => ENOTRECOVERABLE, - - #[cfg(not(target_os = "android"))] - 132 => ERFKILL, - #[cfg(not(target_os = "android"))] - 133 => EHWPOISON, + 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::EAGAIN => EAGAIN, + 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::EDEADLK => EDEADLK, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::ENOTEMPTY => ENOTEMPTY, + libc::ELOOP => ELOOP, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EBFONT => EBFONT, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::EMULTIHOP => EMULTIHOP, + libc::EDOTDOT => EDOTDOT, + libc::EBADMSG => EBADMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::EUSERS => EUSERS, + 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::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + libc::EUCLEAN => EUCLEAN, + libc::ENOTNAM => ENOTNAM, + libc::ENAVAIL => ENAVAIL, + libc::EISNAM => EISNAM, + libc::EREMOTEIO => EREMOTEIO, + libc::EDQUOT => EDQUOT, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::ECANCELED => ECANCELED, + libc::ENOKEY => ENOKEY, + libc::EKEYEXPIRED => EKEYEXPIRED, + libc::EKEYREVOKED => EKEYREVOKED, + 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")))] + libc::EHWPOISON => EHWPOISON, _ => UnknownErrno, } } @@ -2058,7 +2060,7 @@ mod test { } #[test] - #[cfg(target_os = "linux")] + #[cfg(all(target_os = "linux", not(target_arch = "mips")))] pub fn test_linux_not_android_errnos() { check_errno!( ERFKILL /*, |