diff --git a/src/unix/notbsd/linux/mips/mips32.rs b/src/unix/notbsd/linux/mips/mips32.rs index 22bb33b7231f20705d17c3edf1649b1c6181ba0e..57caecd226c5e40f4c0d1b40018c6832e84dbe34 100644 --- a/src/unix/notbsd/linux/mips/mips32.rs +++ b/src/unix/notbsd/linux/mips/mips32.rs @@ -87,6 +87,7 @@ s! { pub sa_sigaction: ::sighandler_t, pub sa_mask: sigset_t, _restorer: *mut ::c_void, + #[cfg(not(target_env = "uclibc"))] _resv: [::c_int; 1], } @@ -97,7 +98,10 @@ s! { } pub struct sigset_t { + #[cfg(not(target_env = "uclibc"))] __val: [::c_ulong; 32], + #[cfg(target_env = "uclibc")] + __val: [::c_ulong; 4], } pub struct siginfo_t { diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs index db580c9db33b67325e9b96a758f21228dbdac16b..93134ed87dff44efa130f17c37ec7dc023ad1f8d 100644 --- a/src/unix/notbsd/linux/mips/mod.rs +++ b/src/unix/notbsd/linux/mips/mod.rs @@ -32,7 +32,10 @@ pub const EPOLL_CLOEXEC: ::c_int = 0x80000; pub const EFD_CLOEXEC: ::c_int = 0x80000; +#[cfg(not(target_env = "uclibc"))] pub const BUFSIZ: ::c_uint = 8192; +#[cfg(target_env = "uclibc")] +pub const BUFSIZ: ::c_uint = 4096; pub const TMP_MAX: ::c_uint = 238328; pub const FOPEN_MAX: ::c_uint = 16; pub const POSIX_FADV_DONTNEED: ::c_int = 4; @@ -51,17 +54,29 @@ pub const RLIMIT_AS: ::c_int = 6; pub const RLIMIT_RSS: ::c_int = 7; pub const RLIMIT_NPROC: ::c_int = 8; pub const RLIMIT_MEMLOCK: ::c_int = 9; +#[cfg(not(target_env = "uclibc"))] pub const RLIMIT_NLIMITS: ::c_int = 16; +#[cfg(target_env = "uclibc")] +pub const RLIMIT_NLIMITS: ::c_int = 15; pub const O_APPEND: ::c_int = 8; pub const O_CREAT: ::c_int = 256; pub const O_EXCL: ::c_int = 1024; pub const O_NOCTTY: ::c_int = 2048; pub const O_NONBLOCK: ::c_int = 128; +#[cfg(not(target_env = "uclibc"))] pub const O_SYNC: ::c_int = 0x4010; +#[cfg(target_env = "uclibc")] +pub const O_SYNC: ::c_int = 0x10; +#[cfg(not(target_env = "uclibc"))] pub const O_RSYNC: ::c_int = 0x4010; +#[cfg(target_env = "uclibc")] +pub const O_RSYNC: ::c_int = 0x10; pub const O_DSYNC: ::c_int = 0x10; +#[cfg(not(target_env = "uclibc"))] pub const O_FSYNC: ::c_int = 0x4010; +#[cfg(target_env = "uclibc")] +pub const O_FSYNC: ::c_int = 0x10; pub const O_ASYNC: ::c_int = 0x1000; pub const O_NDELAY: ::c_int = 0x80; @@ -286,7 +301,10 @@ pub const POLLWRNORM: ::c_short = 0x004; pub const POLLRDBAND: ::c_short = 0x080; pub const POLLWRBAND: ::c_short = 0x100; +#[cfg(not(target_env = "uclibc"))] pub const PTHREAD_STACK_MIN: ::size_t = 131072; +#[cfg(target_env = "uclibc")] +pub const PTHREAD_STACK_MIN: ::size_t = 16384; pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; @@ -355,7 +373,10 @@ pub const PTRACE_SETREGS: ::c_uint = 13; pub const MAP_HUGETLB: ::c_int = 0x080000; +#[cfg(not(target_env = "uclibc"))] pub const EFD_NONBLOCK: ::c_int = 0x80; +#[cfg(target_env = "uclibc")] +pub const EFD_NONBLOCK: ::c_int = 0x800; pub const F_GETLK: ::c_int = 14; pub const F_GETOWN: ::c_int = 23; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 9774f93f6dac13ccca0ca6e62d8d4f69db58cddb..526c39e92974ada859e8a27681b3b7b5e941758b 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -222,78 +222,149 @@ s! { } } -pub const ABDAY_1: ::nl_item = 0x20000; -pub const ABDAY_2: ::nl_item = 0x20001; -pub const ABDAY_3: ::nl_item = 0x20002; -pub const ABDAY_4: ::nl_item = 0x20003; -pub const ABDAY_5: ::nl_item = 0x20004; -pub const ABDAY_6: ::nl_item = 0x20005; -pub const ABDAY_7: ::nl_item = 0x20006; - -pub const DAY_1: ::nl_item = 0x20007; -pub const DAY_2: ::nl_item = 0x20008; -pub const DAY_3: ::nl_item = 0x20009; -pub const DAY_4: ::nl_item = 0x2000A; -pub const DAY_5: ::nl_item = 0x2000B; -pub const DAY_6: ::nl_item = 0x2000C; -pub const DAY_7: ::nl_item = 0x2000D; - -pub const ABMON_1: ::nl_item = 0x2000E; -pub const ABMON_2: ::nl_item = 0x2000F; -pub const ABMON_3: ::nl_item = 0x20010; -pub const ABMON_4: ::nl_item = 0x20011; -pub const ABMON_5: ::nl_item = 0x20012; -pub const ABMON_6: ::nl_item = 0x20013; -pub const ABMON_7: ::nl_item = 0x20014; -pub const ABMON_8: ::nl_item = 0x20015; -pub const ABMON_9: ::nl_item = 0x20016; -pub const ABMON_10: ::nl_item = 0x20017; -pub const ABMON_11: ::nl_item = 0x20018; -pub const ABMON_12: ::nl_item = 0x20019; - -pub const MON_1: ::nl_item = 0x2001A; -pub const MON_2: ::nl_item = 0x2001B; -pub const MON_3: ::nl_item = 0x2001C; -pub const MON_4: ::nl_item = 0x2001D; -pub const MON_5: ::nl_item = 0x2001E; -pub const MON_6: ::nl_item = 0x2001F; -pub const MON_7: ::nl_item = 0x20020; -pub const MON_8: ::nl_item = 0x20021; -pub const MON_9: ::nl_item = 0x20022; -pub const MON_10: ::nl_item = 0x20023; -pub const MON_11: ::nl_item = 0x20024; -pub const MON_12: ::nl_item = 0x20025; - -pub const AM_STR: ::nl_item = 0x20026; -pub const PM_STR: ::nl_item = 0x20027; - -pub const D_T_FMT: ::nl_item = 0x20028; -pub const D_FMT: ::nl_item = 0x20029; -pub const T_FMT: ::nl_item = 0x2002A; -pub const T_FMT_AMPM: ::nl_item = 0x2002B; - -pub const ERA: ::nl_item = 0x2002C; -pub const ERA_D_FMT: ::nl_item = 0x2002E; -pub const ALT_DIGITS: ::nl_item = 0x2002F; -pub const ERA_D_T_FMT: ::nl_item = 0x20030; -pub const ERA_T_FMT: ::nl_item = 0x20031; - -pub const CODESET: ::nl_item = 14; - -pub const CRNCYSTR: ::nl_item = 0x4000F; - -pub const RUSAGE_THREAD: ::c_int = 1; -pub const RUSAGE_CHILDREN: ::c_int = -1; - -pub const RADIXCHAR: ::nl_item = 0x10000; -pub const THOUSEP: ::nl_item = 0x10001; - -pub const YESEXPR: ::nl_item = 0x50000; -pub const NOEXPR: ::nl_item = 0x50001; -pub const YESSTR: ::nl_item = 0x50002; -pub const NOSTR: ::nl_item = 0x50003; - -pub const FILENAME_MAX: ::c_uint = 4096; +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + pub const ABDAY_1: ::nl_item = 0x20000; + pub const ABDAY_2: ::nl_item = 0x20001; + pub const ABDAY_3: ::nl_item = 0x20002; + pub const ABDAY_4: ::nl_item = 0x20003; + pub const ABDAY_5: ::nl_item = 0x20004; + pub const ABDAY_6: ::nl_item = 0x20005; + pub const ABDAY_7: ::nl_item = 0x20006; + + pub const DAY_1: ::nl_item = 0x20007; + pub const DAY_2: ::nl_item = 0x20008; + pub const DAY_3: ::nl_item = 0x20009; + pub const DAY_4: ::nl_item = 0x2000A; + pub const DAY_5: ::nl_item = 0x2000B; + pub const DAY_6: ::nl_item = 0x2000C; + pub const DAY_7: ::nl_item = 0x2000D; + + pub const ABMON_1: ::nl_item = 0x2000E; + pub const ABMON_2: ::nl_item = 0x2000F; + pub const ABMON_3: ::nl_item = 0x20010; + pub const ABMON_4: ::nl_item = 0x20011; + pub const ABMON_5: ::nl_item = 0x20012; + pub const ABMON_6: ::nl_item = 0x20013; + pub const ABMON_7: ::nl_item = 0x20014; + pub const ABMON_8: ::nl_item = 0x20015; + pub const ABMON_9: ::nl_item = 0x20016; + pub const ABMON_10: ::nl_item = 0x20017; + pub const ABMON_11: ::nl_item = 0x20018; + pub const ABMON_12: ::nl_item = 0x20019; + + pub const MON_1: ::nl_item = 0x2001A; + pub const MON_2: ::nl_item = 0x2001B; + pub const MON_3: ::nl_item = 0x2001C; + pub const MON_4: ::nl_item = 0x2001D; + pub const MON_5: ::nl_item = 0x2001E; + pub const MON_6: ::nl_item = 0x2001F; + pub const MON_7: ::nl_item = 0x20020; + pub const MON_8: ::nl_item = 0x20021; + pub const MON_9: ::nl_item = 0x20022; + pub const MON_10: ::nl_item = 0x20023; + pub const MON_11: ::nl_item = 0x20024; + pub const MON_12: ::nl_item = 0x20025; + + pub const AM_STR: ::nl_item = 0x20026; + pub const PM_STR: ::nl_item = 0x20027; + + pub const D_T_FMT: ::nl_item = 0x20028; + pub const D_FMT: ::nl_item = 0x20029; + pub const T_FMT: ::nl_item = 0x2002A; + pub const T_FMT_AMPM: ::nl_item = 0x2002B; + + pub const ERA: ::nl_item = 0x2002C; + pub const ERA_D_FMT: ::nl_item = 0x2002E; + pub const ALT_DIGITS: ::nl_item = 0x2002F; + pub const ERA_D_T_FMT: ::nl_item = 0x20030; + pub const ERA_T_FMT: ::nl_item = 0x20031; + + pub const CODESET: ::nl_item = 14; + + pub const CRNCYSTR: ::nl_item = 0x4000F; + + pub const RADIXCHAR: ::nl_item = 0x10000; + pub const THOUSEP: ::nl_item = 0x10001; + + pub const YESEXPR: ::nl_item = 0x50000; + pub const NOEXPR: ::nl_item = 0x50001; + pub const YESSTR: ::nl_item = 0x50002; + pub const NOSTR: ::nl_item = 0x50003; + + pub const FILENAME_MAX: ::c_uint = 4096; + } else { + pub const ABDAY_1: ::nl_item = 0x300; + pub const ABDAY_2: ::nl_item = 0x301; + pub const ABDAY_3: ::nl_item = 0x302; + pub const ABDAY_4: ::nl_item = 0x303; + pub const ABDAY_5: ::nl_item = 0x304; + pub const ABDAY_6: ::nl_item = 0x305; + pub const ABDAY_7: ::nl_item = 0x306; + + pub const DAY_1: ::nl_item = 0x307; + pub const DAY_2: ::nl_item = 0x308; + pub const DAY_3: ::nl_item = 0x309; + pub const DAY_4: ::nl_item = 0x30A; + pub const DAY_5: ::nl_item = 0x30B; + pub const DAY_6: ::nl_item = 0x30C; + pub const DAY_7: ::nl_item = 0x30D; + + pub const ABMON_1: ::nl_item = 0x30E; + pub const ABMON_2: ::nl_item = 0x30F; + pub const ABMON_3: ::nl_item = 0x310; + pub const ABMON_4: ::nl_item = 0x311; + pub const ABMON_5: ::nl_item = 0x312; + pub const ABMON_6: ::nl_item = 0x313; + pub const ABMON_7: ::nl_item = 0x314; + pub const ABMON_8: ::nl_item = 0x315; + pub const ABMON_9: ::nl_item = 0x316; + pub const ABMON_10: ::nl_item = 0x317; + pub const ABMON_11: ::nl_item = 0x318; + pub const ABMON_12: ::nl_item = 0x319; + + pub const MON_1: ::nl_item = 0x31A; + pub const MON_2: ::nl_item = 0x31B; + pub const MON_3: ::nl_item = 0x31C; + pub const MON_4: ::nl_item = 0x31D; + pub const MON_5: ::nl_item = 0x31E; + pub const MON_6: ::nl_item = 0x31F; + pub const MON_7: ::nl_item = 0x320; + pub const MON_8: ::nl_item = 0x321; + pub const MON_9: ::nl_item = 0x322; + pub const MON_10: ::nl_item = 0x323; + pub const MON_11: ::nl_item = 0x324; + pub const MON_12: ::nl_item = 0x325; + + pub const AM_STR: ::nl_item = 0x326; + pub const PM_STR: ::nl_item = 0x327; + + pub const D_T_FMT: ::nl_item = 0x328; + pub const D_FMT: ::nl_item = 0x329; + pub const T_FMT: ::nl_item = 0x32A; + pub const T_FMT_AMPM: ::nl_item = 0x32B; + + pub const ERA: ::nl_item = 0x32C; + pub const ERA_D_FMT: ::nl_item = 0x32E; + pub const ALT_DIGITS: ::nl_item = 0x32F; + pub const ERA_D_T_FMT: ::nl_item = 0x330; + pub const ERA_T_FMT: ::nl_item = 0x331; + + pub const CODESET: ::nl_item = 10; + + pub const CRNCYSTR: ::nl_item = 0x215; + + pub const RADIXCHAR: ::nl_item = 0x100; + pub const THOUSEP: ::nl_item = 0x101; + + pub const NOEXPR: ::nl_item = 0x501; + pub const YESSTR: ::nl_item = 0x502; + pub const NOSTR: ::nl_item = 0x503; + + pub const FILENAME_MAX: ::c_uint = 4095; + } +} + pub const L_tmpnam: ::c_uint = 20; pub const _PC_LINK_MAX: ::c_int = 0; pub const _PC_MAX_CANON: ::c_int = 1; diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index a9ccae86975141244e835508983861a6103cfca2..edff0af8cdb44d4611aea30b2d88fecdb1e00e55 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -305,8 +305,11 @@ pub const PROT_EXEC: ::c_int = 4; pub const LC_CTYPE: ::c_int = 0; pub const LC_NUMERIC: ::c_int = 1; +#[cfg(not(target_env = "uclibc"))] pub const LC_TIME: ::c_int = 2; +#[cfg(not(target_env = "uclibc"))] pub const LC_COLLATE: ::c_int = 3; +#[cfg(not(target_env = "uclibc"))] pub const LC_MONETARY: ::c_int = 4; pub const LC_MESSAGES: ::c_int = 5; pub const LC_ALL: ::c_int = 6; @@ -317,6 +320,13 @@ pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE); pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY); pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES); // LC_ALL_MASK defined per platform +#[cfg(target_env = "uclibc")] +pub const LC_TIME: ::c_int = 3; +#[cfg(target_env = "uclibc")] +pub const LC_COLLATE: ::c_int = 4; +#[cfg(target_env = "uclibc")] +pub const LC_MONETARY: ::c_int = 2; + pub const MAP_FILE: ::c_int = 0x0000; pub const MAP_SHARED: ::c_int = 0x0001; @@ -639,11 +649,21 @@ pub const QIF_ALL: ::uint32_t = 63; pub const MNT_FORCE: ::c_int = 0x1; -pub const Q_SYNC: ::c_int = 0x800001; -pub const Q_QUOTAON: ::c_int = 0x800002; -pub const Q_QUOTAOFF: ::c_int = 0x800003; -pub const Q_GETQUOTA: ::c_int = 0x800007; -pub const Q_SETQUOTA: ::c_int = 0x800008; +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + pub const Q_SYNC: ::c_int = 0x800001; + pub const Q_QUOTAON: ::c_int = 0x800002; + pub const Q_QUOTAOFF: ::c_int = 0x800003; + pub const Q_GETQUOTA: ::c_int = 0x800007; + pub const Q_SETQUOTA: ::c_int = 0x800008; + } else { + pub const Q_SYNC: ::c_int = 0x600; + pub const Q_QUOTAON: ::c_int = 0x100; + pub const Q_QUOTAOFF: ::c_int = 0x200; + pub const Q_GETQUOTA: ::c_int = 0x300; + pub const Q_SETQUOTA: ::c_int = 0x400; + } +} pub const TCIOFF: ::c_int = 2; pub const TCION: ::c_int = 3;