From b63e15f23805928c7e62b419f80539b9d69c22dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Wed, 13 Dec 2017 06:24:33 +0100 Subject: openbsd: update errno definition --- src/unix/bsd/netbsdlike/openbsdlike/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs index 64e6e4aa52..59b0318dc4 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs @@ -211,7 +211,11 @@ pub const ECANCELED : ::c_int = 88; pub const EIDRM : ::c_int = 89; pub const ENOMSG : ::c_int = 90; pub const ENOTSUP : ::c_int = 91; -pub const ELAST : ::c_int = 91; +pub const EBADMSG : ::c_int = 92; +pub const ENOTRECOVERABLE : ::c_int = 93; +pub const EOWNERDEAD : ::c_int = 94; +pub const EPROTO : ::c_int = 95; +pub const ELAST : ::c_int = 95; pub const F_DUPFD_CLOEXEC : ::c_int = 10; -- cgit v1.2.1 From 94827af073f3e74d444a99345de3ab37c41d4d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Wed, 13 Dec 2017 06:47:44 +0100 Subject: add aarch64-unknown-openbsd definition move c_char definition more deeper to make it 'u8' on aarch64-unknown-openbsd. --- src/unix/bsd/apple/mod.rs | 1 + src/unix/bsd/freebsdlike/mod.rs | 1 + src/unix/bsd/mod.rs | 1 - src/unix/bsd/netbsdlike/netbsd/mod.rs | 1 + src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs | 75 ------------------ src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs | 89 ++++++++++++++++++++++ src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs | 2 + .../bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs | 2 + src/unix/bsd/netbsdlike/openbsdlike/mod.rs | 3 - src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs | 35 --------- .../bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs | 3 + src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs | 50 ++++++++++++ src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs | 3 + .../bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs | 3 + .../bsd/netbsdlike/openbsdlike/other/b32/mod.rs | 2 - .../bsd/netbsdlike/openbsdlike/other/b64/mod.rs | 2 - src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs | 11 --- 17 files changed, 155 insertions(+), 129 deletions(-) delete mode 100644 src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs delete mode 100644 src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs delete mode 100644 src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs delete mode 100644 src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs delete mode 100644 src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 694d394804..5049d39088 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2,6 +2,7 @@ //! //! This covers *-apple-* triples currently +pub type c_char = i8; pub type clock_t = c_ulong; pub type time_t = c_long; pub type suseconds_t = i32; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index e1f2e33093..6a3457196a 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1,3 +1,4 @@ +pub type c_char = i8; pub type dev_t = u32; pub type mode_t = u16; pub type pthread_attr_t = *mut ::c_void; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index a9f9fa87d9..b9a88f09d2 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -1,6 +1,5 @@ use dox::{mem, Option}; -pub type c_char = i8; pub type wchar_t = i32; pub type off_t = i64; pub type useconds_t = u32; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index c3dd2eb1cd..e79e4e94d4 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1,5 +1,6 @@ use dox::mem; +pub type c_char = i8; pub type clock_t = ::c_uint; pub type suseconds_t = ::c_int; pub type dev_t = u64; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs deleted file mode 100644 index 695cf68dc5..0000000000 --- a/src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs +++ /dev/null @@ -1,75 +0,0 @@ -s! { - pub struct lconv { - pub decimal_point: *mut ::c_char, - pub thousands_sep: *mut ::c_char, - pub grouping: *mut ::c_char, - pub int_curr_symbol: *mut ::c_char, - pub currency_symbol: *mut ::c_char, - pub mon_decimal_point: *mut ::c_char, - pub mon_thousands_sep: *mut ::c_char, - pub mon_grouping: *mut ::c_char, - pub positive_sign: *mut ::c_char, - pub negative_sign: *mut ::c_char, - pub int_frac_digits: ::c_char, - pub frac_digits: ::c_char, - pub p_cs_precedes: ::c_char, - pub p_sep_by_space: ::c_char, - pub n_cs_precedes: ::c_char, - pub n_sep_by_space: ::c_char, - pub p_sign_posn: ::c_char, - pub n_sign_posn: ::c_char, - pub int_p_cs_precedes: ::c_char, - pub int_n_cs_precedes: ::c_char, - pub int_p_sep_by_space: ::c_char, - pub int_n_sep_by_space: ::c_char, - pub int_p_sign_posn: ::c_char, - pub int_n_sign_posn: ::c_char, - } -} - -pub const LC_COLLATE_MASK: ::c_int = (1 << 0); -pub const LC_CTYPE_MASK: ::c_int = (1 << 1); -pub const LC_MESSAGES_MASK: ::c_int = (1 << 2); -pub const LC_MONETARY_MASK: ::c_int = (1 << 3); -pub const LC_NUMERIC_MASK: ::c_int = (1 << 4); -pub const LC_TIME_MASK: ::c_int = (1 << 5); -pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK - | LC_CTYPE_MASK - | LC_MESSAGES_MASK - | LC_MONETARY_MASK - | LC_NUMERIC_MASK - | LC_TIME_MASK; - -pub const ERA: ::nl_item = 52; -pub const ERA_D_FMT: ::nl_item = 53; -pub const ERA_D_T_FMT: ::nl_item = 54; -pub const ERA_T_FMT: ::nl_item = 55; -pub const ALT_DIGITS: ::nl_item = 56; - -pub const D_MD_ORDER: ::nl_item = 57; - -pub const ALTMON_1: ::nl_item = 58; -pub const ALTMON_2: ::nl_item = 59; -pub const ALTMON_3: ::nl_item = 60; -pub const ALTMON_4: ::nl_item = 61; -pub const ALTMON_5: ::nl_item = 62; -pub const ALTMON_6: ::nl_item = 63; -pub const ALTMON_7: ::nl_item = 64; -pub const ALTMON_8: ::nl_item = 65; -pub const ALTMON_9: ::nl_item = 66; -pub const ALTMON_10: ::nl_item = 67; -pub const ALTMON_11: ::nl_item = 68; -pub const ALTMON_12: ::nl_item = 69; - -pub const KERN_RND: ::c_int = 31; - -extern { - pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; - pub fn duplocale(base: ::locale_t) -> ::locale_t; - pub fn freelocale(loc: ::locale_t) -> ::c_int; - pub fn newlocale(mask: ::c_int, - locale: *const ::c_char, - base: ::locale_t) -> ::locale_t; - pub fn uselocale(loc: ::locale_t) -> ::locale_t; - pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; -} diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs new file mode 100644 index 0000000000..ac4acadd30 --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs @@ -0,0 +1,89 @@ +pub type c_char = i8; + +s! { + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } +} + +pub const LC_COLLATE_MASK: ::c_int = (1 << 0); +pub const LC_CTYPE_MASK: ::c_int = (1 << 1); +pub const LC_MESSAGES_MASK: ::c_int = (1 << 2); +pub const LC_MONETARY_MASK: ::c_int = (1 << 3); +pub const LC_NUMERIC_MASK: ::c_int = (1 << 4); +pub const LC_TIME_MASK: ::c_int = (1 << 5); +pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK + | LC_CTYPE_MASK + | LC_MESSAGES_MASK + | LC_MONETARY_MASK + | LC_NUMERIC_MASK + | LC_TIME_MASK; + +pub const ERA: ::nl_item = 52; +pub const ERA_D_FMT: ::nl_item = 53; +pub const ERA_D_T_FMT: ::nl_item = 54; +pub const ERA_T_FMT: ::nl_item = 55; +pub const ALT_DIGITS: ::nl_item = 56; + +pub const D_MD_ORDER: ::nl_item = 57; + +pub const ALTMON_1: ::nl_item = 58; +pub const ALTMON_2: ::nl_item = 59; +pub const ALTMON_3: ::nl_item = 60; +pub const ALTMON_4: ::nl_item = 61; +pub const ALTMON_5: ::nl_item = 62; +pub const ALTMON_6: ::nl_item = 63; +pub const ALTMON_7: ::nl_item = 64; +pub const ALTMON_8: ::nl_item = 65; +pub const ALTMON_9: ::nl_item = 66; +pub const ALTMON_10: ::nl_item = 67; +pub const ALTMON_11: ::nl_item = 68; +pub const ALTMON_12: ::nl_item = 69; + +pub const KERN_RND: ::c_int = 31; + +extern { + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t) -> ::c_int; + pub fn newlocale(mask: ::c_int, + locale: *const ::c_char, + base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; +} + +cfg_if! { + if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else { + // Unknown target_arch + } +} diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs new file mode 100644 index 0000000000..9b0b338b91 --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs @@ -0,0 +1,2 @@ +pub type c_long = i32; +pub type c_ulong = u32; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs new file mode 100644 index 0000000000..b07c476aa4 --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs @@ -0,0 +1,2 @@ +pub type c_long = i64; +pub type c_ulong = u64; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs index 59b0318dc4..1f40e346c8 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs @@ -748,6 +748,3 @@ cfg_if! { // Unknown target_os } } - -mod other; -pub use self::other::*; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs b/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs deleted file mode 100644 index 5c804473ad..0000000000 --- a/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs +++ /dev/null @@ -1,35 +0,0 @@ -s! { - pub struct lconv { - pub decimal_point: *mut ::c_char, - pub thousands_sep: *mut ::c_char, - pub grouping: *mut ::c_char, - pub int_curr_symbol: *mut ::c_char, - pub currency_symbol: *mut ::c_char, - pub mon_decimal_point: *mut ::c_char, - pub mon_thousands_sep: *mut ::c_char, - pub mon_grouping: *mut ::c_char, - pub positive_sign: *mut ::c_char, - pub negative_sign: *mut ::c_char, - pub int_frac_digits: ::c_char, - pub frac_digits: ::c_char, - pub p_cs_precedes: ::c_char, - pub p_sep_by_space: ::c_char, - pub n_cs_precedes: ::c_char, - pub n_sep_by_space: ::c_char, - pub p_sign_posn: ::c_char, - pub n_sign_posn: ::c_char, - pub int_p_cs_precedes: ::c_char, - pub int_p_sep_by_space: ::c_char, - pub int_n_cs_precedes: ::c_char, - pub int_n_sep_by_space: ::c_char, - pub int_p_sign_posn: ::c_char, - pub int_n_sign_posn: ::c_char, - } -} - -extern { - pub fn accept4(s: ::c_int, addr: *mut ::sockaddr, - addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int; - pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, - envp: *const *const ::c_char) -> ::c_int; -} diff --git a/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs new file mode 100644 index 0000000000..6aa9950ed1 --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs @@ -0,0 +1,3 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = u8; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs new file mode 100644 index 0000000000..e7e5876ba4 --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs @@ -0,0 +1,50 @@ +s! { + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } +} + +extern { + pub fn accept4(s: ::c_int, addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int; + pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, + envp: *const *const ::c_char) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else { + // Unknown target_arch + } +} diff --git a/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs new file mode 100644 index 0000000000..a00e3337ef --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs @@ -0,0 +1,3 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = i8; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs new file mode 100644 index 0000000000..27b9412668 --- /dev/null +++ b/src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs @@ -0,0 +1,3 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs deleted file mode 100644 index 9b0b338b91..0000000000 --- a/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub type c_long = i32; -pub type c_ulong = u32; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs deleted file mode 100644 index b07c476aa4..0000000000 --- a/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub type c_long = i64; -pub type c_ulong = u64; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs deleted file mode 100644 index e4087da7bc..0000000000 --- a/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -cfg_if! { - if #[cfg(target_arch = "x86_64")] { - mod b64; - pub use self::b64::*; - } else if #[cfg(target_arch = "x86")] { - mod b32; - pub use self::b32::*; - } else { - // Unknown target_arch - } -} -- cgit v1.2.1