From e2604a756aaddcd5919ee2f1b9cc0055d200f846 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 10 Dec 2018 21:00:27 -0800 Subject: Update libc crate to 0.2.45 This change updates the libc crate to version 0.2.45. Import subrepo libc/:libc at f5636fc618f8e16968b3178196d73c94ad9f7b05 --- libc/src/unix/uclibc/mod.rs | 122 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 94 insertions(+), 28 deletions(-) (limited to 'libc/src/unix/uclibc/mod.rs') diff --git a/libc/src/unix/uclibc/mod.rs b/libc/src/unix/uclibc/mod.rs index 3f3a2ba..9d8e97e 100644 --- a/libc/src/unix/uclibc/mod.rs +++ b/libc/src/unix/uclibc/mod.rs @@ -11,7 +11,6 @@ pub type id_t = ::c_uint; pub type useconds_t = u32; pub type dev_t = u64; pub type socklen_t = u32; -pub type pthread_t = ::c_ulong; pub type mode_t = u32; pub type ino64_t = u64; pub type off64_t = i64; @@ -225,34 +224,80 @@ s! { pub ifa_data: *mut ::c_void } + #[cfg_attr(all(feature = "align", + target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")), + repr(align(4)))] + #[cfg_attr(all(feature = "align", + any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))), + repr(align(8)))] pub struct pthread_mutex_t { - #[cfg(any(target_arch = "mips", target_arch = "arm", - target_arch = "powerpc"))] + #[cfg(all(not(feature = "align"), + any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))] __align: [::c_long; 0], - #[cfg(not(any(target_arch = "mips", target_arch = "arm", + #[cfg(not(any(feature = "align", + target_arch = "mips", + target_arch = "arm", target_arch = "powerpc")))] __align: [::c_longlong; 0], size: [u8; __SIZEOF_PTHREAD_MUTEX_T], } + #[cfg_attr(all(feature = "align", + target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")), + repr(align(4)))] + #[cfg_attr(all(feature = "align", + any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))), + repr(align(8)))] pub struct pthread_rwlock_t { - #[cfg(any(target_arch = "mips", target_arch = "arm", - target_arch = "powerpc"))] + #[cfg(all(not(feature = "align"), + any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))] __align: [::c_long; 0], - #[cfg(not(any(target_arch = "mips", target_arch = "arm", + #[cfg(not(any(feature = "align", + target_arch = "mips", + target_arch = "arm", target_arch = "powerpc")))] __align: [::c_longlong; 0], size: [u8; __SIZEOF_PTHREAD_RWLOCK_T], } + #[cfg_attr(all(feature = "align", + any(target_pointer_width = "32", + target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64")), + repr(align(4)))] + #[cfg_attr(all(feature = "align", + not(any(target_pointer_width = "32", + target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64"))), + repr(align(8)))] pub struct pthread_mutexattr_t { - #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", - target_arch = "mips64", target_arch = "s390x", - target_arch = "sparc64"))] - __align: [::c_int; 0], - #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", + #[cfg(all(not(feature = "align"), + any(target_arch = "x86_64", target_arch = "powerpc64", target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64")))] + __align: [::c_int; 0], + #[cfg(all(not(feature = "align"), + not(any(target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64"))))] __align: [::c_long; 0], size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T], } @@ -262,12 +307,16 @@ s! { __pshared: ::c_int, } + #[cfg_attr(feature = "align", repr(align(8)))] pub struct pthread_cond_t { + #[cfg(not(feature = "align"))] __align: [::c_longlong; 0], size: [u8; __SIZEOF_PTHREAD_COND_T], } + #[cfg_attr(feature = "align", repr(align(4)))] pub struct pthread_condattr_t { + #[cfg(not(feature = "align"))] __align: [::c_int; 0], size: [u8; __SIZEOF_PTHREAD_CONDATTR_T], } @@ -342,7 +391,12 @@ s! { pub ssi_utime: ::uint64_t, pub ssi_stime: ::uint64_t, pub ssi_addr: ::uint64_t, - _pad: [::uint8_t; 48], + pub ssi_addr_lsb: ::uint16_t, + _pad2: ::uint16_t, + pub ssi_syscall: ::int32_t, + pub ssi_call_addr: ::uint64_t, + pub ssi_arch: ::uint32_t, + _pad: [::uint8_t; 28], } pub struct fsid_t { @@ -1117,18 +1171,17 @@ pub const RTLD_NOW: ::c_int = 0x2; pub const TCP_MD5SIG: ::c_int = 14; -pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { - __align: [], - size: [0; __SIZEOF_PTHREAD_MUTEX_T], -}; -pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { - __align: [], - size: [0; __SIZEOF_PTHREAD_COND_T], -}; -pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { - __align: [], - size: [0; __SIZEOF_PTHREAD_RWLOCK_T], -}; +align_const! { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + size: [0; __SIZEOF_PTHREAD_MUTEX_T], + }; + pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + size: [0; __SIZEOF_PTHREAD_COND_T], + }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + size: [0; __SIZEOF_PTHREAD_RWLOCK_T], + }; +} pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; @@ -1329,6 +1382,9 @@ pub const PR_GET_TID_ADDRESS: ::c_int = 40; pub const PR_SET_THP_DISABLE: ::c_int = 41; pub const PR_GET_THP_DISABLE: ::c_int = 42; +pub const GRND_NONBLOCK: ::c_uint = 0x0001; +pub const GRND_RANDOM: ::c_uint = 0x0002; + pub const ABDAY_1: ::nl_item = 0x300; pub const ABDAY_2: ::nl_item = 0x301; pub const ABDAY_3: ::nl_item = 0x302; @@ -1495,6 +1551,12 @@ f! { } extern { + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + pub fn fdatasync(fd: ::c_int) -> ::c_int; pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar) -> ::c_int; @@ -1583,6 +1645,8 @@ extern { pub fn uselocale(loc: ::locale_t) -> ::locale_t; pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; + pub fn fstatat64(fildes: ::c_int, path: *const ::c_char, + buf: *mut stat64, flag: ::c_int) -> ::c_int; pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; @@ -1610,8 +1674,6 @@ extern { pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; - pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; - pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, dev: dev_t) -> ::c_int; pub fn ppoll(fds: *mut ::pollfd, @@ -1635,6 +1697,8 @@ extern { pub fn unshare(flags: ::c_int) -> ::c_int; pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, + sval: *mut ::c_int) -> ::c_int; pub fn accept4(fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t, flg: ::c_int) -> ::c_int; pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t, @@ -1802,6 +1866,8 @@ extern { pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; @@ -1890,7 +1956,7 @@ extern { } cfg_if! { - if #[cfg(target_arch = "mips")] { + if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] { mod mips; pub use self::mips::*; } else if #[cfg(target_arch = "x86_64")] { -- cgit v1.2.1