diff options
-rw-r--r-- | nix-test/src/const.c | 32 | ||||
-rw-r--r-- | src/sys/socket/consts.rs | 5 |
2 files changed, 26 insertions, 11 deletions
diff --git a/nix-test/src/const.c b/nix-test/src/const.c index 41ff7843..a09fc6d5 100644 --- a/nix-test/src/const.c +++ b/nix-test/src/const.c @@ -161,8 +161,15 @@ get_int_const(const char* err) { // GET_CONST(EHWPOISON); #endif #endif - -#ifdef DARWIN +#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); @@ -176,32 +183,35 @@ get_int_const(const char* err) { GET_CONST(EPROCUNAVAIL); GET_CONST(EFTYPE); GET_CONST(EAUTH); - GET_CONST(ENEEDAUTH); + GET_CONST(ECANCELED); +#endif + +#ifdef DARWIN GET_CONST(EPWROFF); GET_CONST(EDEVERR); - GET_CONST(EOVERFLOW); GET_CONST(EBADEXEC); GET_CONST(EBADARCH); GET_CONST(ESHLIBVERS); GET_CONST(EBADMACHO); - GET_CONST(ECANCELED); - GET_CONST(EILSEQ); - GET_CONST(ENOATTR); - GET_CONST(EBADMSG); GET_CONST(EMULTIHOP); GET_CONST(ENODATA); GET_CONST(ENOLINK); GET_CONST(ENOSR); GET_CONST(ENOSTR); - GET_CONST(EPROTO); GET_CONST(ETIME); GET_CONST(EOPNOTSUPP); GET_CONST(ENOPOLICY); - GET_CONST(ENOTRECOVERABLE); - GET_CONST(EOWNERDEAD); GET_CONST(EQFULL); #endif +#ifdef __FreeBSD__ + GET_CONST(EDOOFUS); + GET_CONST(EMULTIHOP); + GET_CONST(ENOLINK); + GET_CONST(ENOTCAPABLE); + GET_CONST(ECAPMODE); +#endif + /* * * ===== SOCKET OPTIONS ===== diff --git a/src/sys/socket/consts.rs b/src/sys/socket/consts.rs index 00007480..ddd77c05 100644 --- a/src/sys/socket/consts.rs +++ b/src/sys/socket/consts.rs @@ -109,6 +109,11 @@ mod os { pub const AF_UNIX: c_int = 1; pub const AF_LOCAL: c_int = AF_UNIX; pub const AF_INET: c_int = 2; + #[cfg(target_os = "openbsd")] + pub const AF_INET6: c_int = 26; + #[cfg(target_os = "freebsd")] + pub const AF_INET6: c_int = 28; + #[cfg(any(target_os = "macos", target_os = "ios"))] pub const AF_INET6: c_int = 30; pub const SOCK_STREAM: c_int = 1; |