summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rw-r--r--README.md1
-rw-r--r--nix-test/Cargo.toml15
-rw-r--r--nix-test/build.rs21
-rw-r--r--nix-test/src/const.c268
-rw-r--r--nix-test/src/lib.rs61
-rw-r--r--nix-test/src/sizes.c32
-rw-r--r--src/errno.rs2580
-rw-r--r--src/lib.rs3
-rw-r--r--src/sys/socket/mod.rs6
-rw-r--r--src/sys/uio.rs6
-rw-r--r--test/test.rs10
12 files changed, 1137 insertions, 1867 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f9e37545..58161be0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,6 @@ lazy_static = "1"
rand = "0.3.8"
tempdir = "0.3"
tempfile = "2"
-nix-test = { path = "nix-test", version = "0.0.1" }
[[test]]
name = "test"
diff --git a/README.md b/README.md
index 5ca0ccdf..317567f5 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,7 @@ Then, add this to your crate root:
```rust,ignore
extern crate nix;
```
+
## Contributing
Contributions are very welcome. Please See [CONTRIBUTING](CONTRIBUTING.md) for
diff --git a/nix-test/Cargo.toml b/nix-test/Cargo.toml
deleted file mode 100644
index e62a8e52..00000000
--- a/nix-test/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-
-name = "nix-test"
-description = "Testing helpers for Nix"
-version = "0.0.1"
-authors = ["Carl Lerche <me@carllerche.com>"]
-homepage = "https://github.com/carllerche/nix-rust"
-build = "build.rs"
-license = "MIT"
-
-[dependencies]
-libc = "*"
-
-[build-dependencies]
-gcc = "0.3.8"
diff --git a/nix-test/build.rs b/nix-test/build.rs
deleted file mode 100644
index 5d1b1bba..00000000
--- a/nix-test/build.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-extern crate gcc;
-
-use std::env;
-
-pub fn main() {
- let target = env::var("TARGET").unwrap();
-
- let os = if target.contains("linux") {
- "LINUX"
- } else if target.contains("darwin") {
- "DARWIN"
- } else {
- "UNKNOWN"
- };
-
- gcc::Build::new()
- .file("src/const.c")
- .file("src/sizes.c")
- .define(os, None)
- .compile("libnixtest.a");
-}
diff --git a/nix-test/src/const.c b/nix-test/src/const.c
deleted file mode 100644
index bb70fc92..00000000
--- a/nix-test/src/const.c
+++ /dev/null
@@ -1,268 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip6.h>
-#include <netinet/tcp.h>
-#include <netinet/udp.h>
-
-#define GET_CONST(CONST) \
- do { \
- if (0 == strcmp(err, #CONST)) { \
- return CONST; \
- } \
- } while (0)
-
-int
-get_int_const(const char* err) {
-
- /*
- *
- * ===== ERRNO =====
- *
- */
-
- GET_CONST(EPERM);
- GET_CONST(ENOENT);
- GET_CONST(ESRCH);
- GET_CONST(EINTR);
- GET_CONST(EIO);
- GET_CONST(ENXIO);
- GET_CONST(E2BIG);
- GET_CONST(ENOEXEC);
- GET_CONST(EBADF);
- GET_CONST(ECHILD);
- GET_CONST(EAGAIN);
- GET_CONST(ENOMEM);
- GET_CONST(EACCES);
- GET_CONST(EFAULT);
- GET_CONST(ENOTBLK);
- GET_CONST(EBUSY);
- GET_CONST(EEXIST);
- GET_CONST(EXDEV);
- GET_CONST(ENODEV);
- GET_CONST(ENOTDIR);
- GET_CONST(EISDIR);
- GET_CONST(EINVAL);
- GET_CONST(ENFILE);
- GET_CONST(EMFILE);
- GET_CONST(ENOTTY);
- GET_CONST(ETXTBSY);
- GET_CONST(EFBIG);
- GET_CONST(ENOSPC);
- GET_CONST(ESPIPE);
- GET_CONST(EROFS);
- GET_CONST(EMLINK);
- GET_CONST(EPIPE);
- GET_CONST(EDOM);
- GET_CONST(ERANGE);
- GET_CONST(EDEADLK);
- GET_CONST(ENAMETOOLONG);
- GET_CONST(ENOLCK);
- GET_CONST(ENOSYS);
- GET_CONST(ENOTEMPTY);
- GET_CONST(ELOOP);
- GET_CONST(ENOMSG);
- GET_CONST(EIDRM);
- GET_CONST(EINPROGRESS);
- GET_CONST(EALREADY);
- GET_CONST(ENOTSOCK);
- GET_CONST(EDESTADDRREQ);
- GET_CONST(EMSGSIZE);
- GET_CONST(EPROTOTYPE);
- GET_CONST(ENOPROTOOPT);
- GET_CONST(EPROTONOSUPPORT);
- GET_CONST(ESOCKTNOSUPPORT);
- GET_CONST(EPFNOSUPPORT);
- GET_CONST(EAFNOSUPPORT);
- GET_CONST(EADDRINUSE);
- GET_CONST(EADDRNOTAVAIL);
- GET_CONST(ENETDOWN);
- GET_CONST(ENETUNREACH);
- GET_CONST(ENETRESET);
- GET_CONST(ECONNABORTED);
- GET_CONST(ECONNRESET);
- GET_CONST(ENOBUFS);
- GET_CONST(EISCONN);
- GET_CONST(ENOTCONN);
- GET_CONST(ESHUTDOWN);
- GET_CONST(ETOOMANYREFS);
- GET_CONST(ETIMEDOUT);
- GET_CONST(ECONNREFUSED);
- GET_CONST(EHOSTDOWN);
- GET_CONST(EHOSTUNREACH);
-
-#ifdef LINUX
- GET_CONST(ECHRNG);
- GET_CONST(EL2NSYNC);
- GET_CONST(EL3HLT);
- GET_CONST(EL3RST);
- GET_CONST(ELNRNG);
- GET_CONST(EUNATCH);
- GET_CONST(ENOCSI);
- GET_CONST(EL2HLT);
- GET_CONST(EBADE);
- GET_CONST(EBADR);
- GET_CONST(EXFULL);
- GET_CONST(ENOANO);
- GET_CONST(EBADRQC);
- GET_CONST(EBADSLT);
- GET_CONST(EBFONT);
- GET_CONST(ENOSTR);
- GET_CONST(ENODATA);
- GET_CONST(ETIME);
- GET_CONST(ENOSR);
- GET_CONST(ENONET);
- GET_CONST(ENOPKG);
- GET_CONST(EREMOTE);
- GET_CONST(ENOLINK);
- GET_CONST(EADV);
- GET_CONST(ESRMNT);
- GET_CONST(ECOMM);
- GET_CONST(EPROTO);
- GET_CONST(EMULTIHOP);
- GET_CONST(EDOTDOT);
- GET_CONST(EBADMSG);
- GET_CONST(EOVERFLOW);
- GET_CONST(ENOTUNIQ);
- GET_CONST(EBADFD);
- GET_CONST(EREMCHG);
- GET_CONST(ELIBACC);
- GET_CONST(ELIBBAD);
- GET_CONST(ELIBSCN);
- GET_CONST(ELIBMAX);
- GET_CONST(ELIBEXEC);
- GET_CONST(EILSEQ);
- GET_CONST(ERESTART);
- GET_CONST(ESTRPIPE);
- GET_CONST(EUSERS);
- GET_CONST(EOPNOTSUPP);
- GET_CONST(ESTALE);
- GET_CONST(EUCLEAN);
- GET_CONST(ENOTNAM);
- GET_CONST(ENAVAIL);
- GET_CONST(EISNAM);
- GET_CONST(EREMOTEIO);
- GET_CONST(EDQUOT);
- GET_CONST(ENOMEDIUM);
- GET_CONST(EMEDIUMTYPE);
- GET_CONST(ECANCELED);
- GET_CONST(ENOKEY);
- GET_CONST(EKEYEXPIRED);
- GET_CONST(EKEYREVOKED);
- GET_CONST(EKEYREJECTED);
- GET_CONST(EOWNERDEAD);
- GET_CONST(ENOTRECOVERABLE);
-#ifndef __ANDROID__
- GET_CONST(ERFKILL);
- // GET_CONST(EHWPOISON);
-#endif
-#endif
-#if defined(DARWIN) || defined(__FreeBSD__)
- GET_CONST(ENEEDAUTH);
- GET_CONST(EOVERFLOW);
- GET_CONST(EILSEQ);
- GET_CONST(ENOATTR);
- GET_CONST(EBADMSG);
- GET_CONST(EPROTO);
- GET_CONST(ENOTRECOVERABLE);
- GET_CONST(EOWNERDEAD);
- GET_CONST(ENOTSUP);
- GET_CONST(EPROCLIM);
- GET_CONST(EUSERS);
- GET_CONST(EDQUOT);
- GET_CONST(ESTALE);
- GET_CONST(EREMOTE);
- GET_CONST(EBADRPC);
- GET_CONST(ERPCMISMATCH);
- GET_CONST(EPROGUNAVAIL);
- GET_CONST(EPROGMISMATCH);
- GET_CONST(EPROCUNAVAIL);
- GET_CONST(EFTYPE);
- GET_CONST(EAUTH);
- GET_CONST(ECANCELED);
-#endif
-
-#if defined(__DragonFly__)
- GET_CONST(ENEEDAUTH);
- GET_CONST(EOVERFLOW);
- GET_CONST(EILSEQ);
- GET_CONST(ENOATTR);
- GET_CONST(EBADMSG);
- GET_CONST(EPROTO);
- GET_CONST(ENOTSUP);
- GET_CONST(EPROCLIM);
- GET_CONST(EUSERS);
- GET_CONST(EDQUOT);
- GET_CONST(ESTALE);
- GET_CONST(EREMOTE);
- GET_CONST(EBADRPC);
- GET_CONST(ERPCMISMATCH);
- GET_CONST(EPROGUNAVAIL);
- GET_CONST(EPROGMISMATCH);
- GET_CONST(EPROCUNAVAIL);
- GET_CONST(EFTYPE);
- GET_CONST(EAUTH);
- GET_CONST(ECANCELED);
-#endif
-
-#if defined(__OpenBSD__)
- GET_CONST(EAUTH);
- GET_CONST(EBADRPC);
- GET_CONST(ECANCELED);
- GET_CONST(EDQUOT);
- GET_CONST(EFTYPE);
- GET_CONST(EILSEQ);
- GET_CONST(EIPSEC);
- GET_CONST(EMEDIUMTYPE);
- GET_CONST(ENEEDAUTH);
- GET_CONST(ENOATTR);
- GET_CONST(ENOMEDIUM);
- GET_CONST(ENOTSUP);
- GET_CONST(EOPNOTSUPP);
- GET_CONST(EOVERFLOW);
- GET_CONST(EPROCLIM);
- GET_CONST(EPROCUNAVAIL);
- GET_CONST(EPROGMISMATCH);
- GET_CONST(EPROGUNAVAIL);
- GET_CONST(EREMOTE);
- GET_CONST(ERPCMISMATCH);
- GET_CONST(ESTALE);
- GET_CONST(EUSERS);
-#endif
-
-#ifdef DARWIN
- GET_CONST(EPWROFF);
- GET_CONST(EDEVERR);
- GET_CONST(EBADEXEC);
- GET_CONST(EBADARCH);
- GET_CONST(ESHLIBVERS);
- GET_CONST(EBADMACHO);
- GET_CONST(EMULTIHOP);
- GET_CONST(ENODATA);
- GET_CONST(ENOLINK);
- GET_CONST(ENOSR);
- GET_CONST(ENOSTR);
- GET_CONST(ETIME);
- GET_CONST(EOPNOTSUPP);
- GET_CONST(ENOPOLICY);
- GET_CONST(EQFULL);
-#endif
-
-#if defined(__FreeBSD__) || defined(__DragonFly__)
- GET_CONST(EDOOFUS);
- GET_CONST(EMULTIHOP);
- GET_CONST(ENOLINK);
-#endif
-
-#ifdef __FreeBSD__
- GET_CONST(ENOTCAPABLE);
- GET_CONST(ECAPMODE);
-#endif
-
- return -1;
-
-}
diff --git a/nix-test/src/lib.rs b/nix-test/src/lib.rs
deleted file mode 100644
index cfe7b798..00000000
--- a/nix-test/src/lib.rs
+++ /dev/null
@@ -1,61 +0,0 @@
-extern crate libc;
-
-use std::fmt;
-use std::ffi::CString;
-use libc::{c_int, c_char};
-
-mod ffi {
- use libc::{c_int, c_char, size_t};
-
- #[link(name = "nixtest", kind = "static")]
- extern {
- pub fn get_int_const(errno: *const c_char) -> c_int;
- pub fn size_of(ty: *const c_char) -> size_t;
- }
-}
-
-pub fn assert_const_eq<T: GetConst>(name: &str, actual: T) {
- unsafe {
- let cstr = CString::new(name).unwrap();
- let expect = GetConst::get_const(cstr.as_ptr());
-
- if actual != expect {
- panic!("incorrect value for errno {}; expect={}; actual={}",
- name, expect, actual);
- }
- }
-}
-
-pub fn assert_size_of<T>(name: &str) {
- use std::mem;
-
- unsafe {
- let cstr = CString::new(name).unwrap();
- let expect = ffi::size_of(cstr.as_ptr()) as usize;
-
- assert!(expect > 0, "undefined type {}", name);
-
- if mem::size_of::<T>() != expect {
- panic!("incorrectly sized type; expect={}; actual={}",
- expect, mem::size_of::<T>());
- }
- }
-}
-
-pub use ffi::get_int_const;
-
-pub trait GetConst : PartialEq<Self> + fmt::Display {
- unsafe fn get_const(name: *const c_char) -> Self;
-}
-
-impl GetConst for c_int {
- unsafe fn get_const(name: *const c_char) -> c_int {
- ffi::get_int_const(name)
- }
-}
-
-impl GetConst for u32 {
- unsafe fn get_const(name: *const c_char) -> u32 {
- ffi::get_int_const(name) as u32
- }
-}
diff --git a/nix-test/src/sizes.c b/nix-test/src/sizes.c
deleted file mode 100644
index ca862003..00000000
--- a/nix-test/src/sizes.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-#include <string.h>
-
-#define SIZE_OF_T(TYPE) \
- do { \
- if (0 == strcmp(type, #TYPE)) { \
- return sizeof(TYPE); \
- } \
- } while (0)
-
-#define SIZE_OF_S(TYPE) \
- do { \
- if (0 == strcmp(type, #TYPE)) { \
- return sizeof(struct TYPE); \
- } \
- } while (0)
-
-size_t
-size_of(const char* type) {
- // Builtin
- SIZE_OF_T(long);
-
- // sys/socket
- SIZE_OF_S(sockaddr_storage);
-
- // sys/uio
- SIZE_OF_S(iovec);
-
- return 0;
-}
diff --git a/src/errno.rs b/src/errno.rs
index cbbf8380..aa152170 100644
--- a/src/errno.rs
+++ b/src/errno.rs
@@ -288,7 +288,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",
@@ -515,143 +515,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;
@@ -661,7 +661,7 @@ mod consts {
use self::Errno::*;
match e {
- 0 => UnknownErrno,
+ 0 => UnknownErrno,
libc::EPERM => EPERM,
libc::ENOENT => ENOENT,
libc::ESRCH => ESRCH,
@@ -791,7 +791,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")))]
@@ -803,115 +802,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;
@@ -924,113 +926,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,
}
}
@@ -1038,106 +1040,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;
@@ -1150,103 +1154,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,
}
}
@@ -1255,109 +1259,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;
@@ -1371,106 +1377,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,
}
}
@@ -1479,100 +1485,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;
@@ -1584,98 +1593,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,
}
}
@@ -1683,105 +1692,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;
@@ -1793,424 +1805,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
- );
- }
-}
diff --git a/src/lib.rs b/src/lib.rs
index f900067c..8ddfad9b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,9 +18,6 @@ extern crate bitflags;
extern crate cfg_if;
extern crate void;
-#[cfg(test)]
-extern crate nix_test as nixtest;
-
#[macro_use] mod macros;
pub extern crate libc;
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index c7d6d581..bd8764b7 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -964,9 +964,3 @@ pub fn shutdown(df: RawFd, how: Shutdown) -> Result<()> {
Errno::result(shutdown(df, how)).map(drop)
}
}
-
-#[test]
-pub fn test_struct_sizes() {
- use nixtest;
- nixtest::assert_size_of::<sockaddr_storage>("sockaddr_storage");
-}
diff --git a/src/sys/uio.rs b/src/sys/uio.rs
index cd161423..c785225b 100644
--- a/src/sys/uio.rs
+++ b/src/sys/uio.rs
@@ -169,9 +169,3 @@ impl<'a> IoVec<&'a mut [u8]> {
}, PhantomData)
}
}
-
-#[test]
-pub fn test_size_of_io_vec() {
- use nixtest;
- nixtest::assert_size_of::<IoVec<&[u8]>>("iovec");
-}
diff --git a/test/test.rs b/test/test.rs
index f4942d3d..42065694 100644
--- a/test/test.rs
+++ b/test/test.rs
@@ -9,8 +9,6 @@ extern crate rand;
extern crate tempdir;
extern crate tempfile;
-extern crate nix_test as nixtest;
-
mod sys;
mod test_fcntl;
#[cfg(target_os = "linux")]
@@ -24,7 +22,6 @@ mod test_sendfile;
mod test_stat;
mod test_unistd;
-use nixtest::assert_size_of;
use std::os::unix::io::RawFd;
use std::sync::Mutex;
use nix::unistd::read;
@@ -54,10 +51,3 @@ lazy_static! {
/// Any test that alters signal handling must grab this mutex.
pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(());
}
-
-#[test]
-pub fn test_size_of_long() {
- // This test is mostly here to ensure that 32bit CI is correctly
- // functioning
- assert_size_of::<usize>("long");
-}