From 4355dfcfa4424ed7c3a771e72d676de35f6de62e Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 4 Apr 2018 13:44:22 +0900 Subject: [PATCH 1/2] Add PTHREAD_MUTEX_ADAPTIVE_NP for glibc --- src/unix/notbsd/linux/mips/mod.rs | 1 + src/unix/notbsd/linux/other/mod.rs | 1 + src/unix/notbsd/linux/s390x.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs index 405a2bdb12422..f3d19d33bd364 100644 --- a/src/unix/notbsd/linux/mips/mod.rs +++ b/src/unix/notbsd/linux/mips/mod.rs @@ -463,6 +463,7 @@ pub const POLLWRNORM: ::c_short = 0x004; pub const POLLWRBAND: ::c_short = 0x100; pub const PTHREAD_STACK_MIN: ::size_t = 131072; +pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs index b566a95577bd1..f147576e142eb 100644 --- a/src/unix/notbsd/linux/other/mod.rs +++ b/src/unix/notbsd/linux/other/mod.rs @@ -813,6 +813,7 @@ cfg_if! { pub const PTHREAD_STACK_MIN: ::size_t = 131072; } } +pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; f! { pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs index 103abcc79037d..3aa2b5114fa39 100644 --- a/src/unix/notbsd/linux/s390x.rs +++ b/src/unix/notbsd/linux/s390x.rs @@ -374,6 +374,7 @@ pub const O_CREAT: ::c_int = 64; pub const O_EXCL: ::c_int = 128; pub const O_NONBLOCK: ::c_int = 2048; pub const PTHREAD_STACK_MIN: ::size_t = 16384; +pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; pub const RLIM_INFINITY: ::rlim_t = 0xffffffffffffffff; pub const SA_NOCLDWAIT: ::c_int = 2; pub const SA_ONSTACK: ::c_int = 0x08000000; From d9013273a03c93732187d5ab3731b5448679aa1c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 4 Apr 2018 15:23:43 +0900 Subject: [PATCH 2/2] Add PTHREAD_*_MUTEX_INITIALIZER_NP for glibc `pthread_mutex_t` varies across architectures, in several ways: - endianness alters the ordering of bytes, since the contents of the struct are larger than 8-bit. - its length varies. - the location of the mutex kind (`PTHREAD_MUTEX_RECURSIVE`, `PTHREAD_MUTEX_ERRORCHECK` or `PTHREAD_MUTEX_ADAPTIVE_NP`) varies between 32-bit and 64-bit: On 32-bit architectures, it is preceded by three int/unsigned int, while on 64-bit architectures, it is preceded by four of them. These initializers are only available from when _GNU_SOURCE is defined. Relax the cfg_if check in ci/style.rs to allow #[cfg(target_endian)] tests. --- ci/style.rs | 4 +- src/unix/notbsd/linux/mips/mips32.rs | 55 ++++++++++++++++++++ src/unix/notbsd/linux/mips/mips64.rs | 55 ++++++++++++++++++++ src/unix/notbsd/linux/other/b32/mod.rs | 55 ++++++++++++++++++++ src/unix/notbsd/linux/other/b64/aarch64.rs | 28 ++++++++++ src/unix/notbsd/linux/other/b64/not_x32.rs | 55 ++++++++++++++++++++ src/unix/notbsd/linux/other/b64/powerpc64.rs | 55 ++++++++++++++++++++ src/unix/notbsd/linux/other/b64/sparc64.rs | 25 +++++++++ src/unix/notbsd/linux/other/b64/x32.rs | 25 +++++++++ src/unix/notbsd/linux/s390x.rs | 25 +++++++++ 10 files changed, 381 insertions(+), 1 deletion(-) diff --git a/ci/style.rs b/ci/style.rs index 32e4ba772c5b7..bf31576b909ac 100644 --- a/ci/style.rs +++ b/ci/style.rs @@ -127,7 +127,9 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) { if line.contains("extern \"C\"") { err.error(path, i, "use `extern` instead of `extern \"C\""); } - if line.contains("#[cfg(") && !line.contains(" if ") { + if line.contains("#[cfg(") && !line.contains(" if ") + && !line.contains("target_endian") + { if state != State::Structs { err.error(path, i, "use cfg_if! and submodules \ instead of #[cfg]"); diff --git a/src/unix/notbsd/linux/mips/mips32.rs b/src/unix/notbsd/linux/mips/mips32.rs index 8fad85b006eb1..d36c77a166e24 100644 --- a/src/unix/notbsd/linux/mips/mips32.rs +++ b/src/unix/notbsd/linux/mips/mips32.rs @@ -265,6 +265,61 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; +#[cfg(target_endian = "little")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; + pub const O_LARGEFILE: ::c_int = 0x2000; pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff; diff --git a/src/unix/notbsd/linux/mips/mips64.rs b/src/unix/notbsd/linux/mips/mips64.rs index 45b3df8fc1477..b575cfe12ae37 100644 --- a/src/unix/notbsd/linux/mips/mips64.rs +++ b/src/unix/notbsd/linux/mips/mips64.rs @@ -247,6 +247,61 @@ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; +#[cfg(target_endian = "little")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const O_LARGEFILE: ::c_int = 0; pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff; diff --git a/src/unix/notbsd/linux/other/b32/mod.rs b/src/unix/notbsd/linux/other/b32/mod.rs index 8536353fb49eb..7294e71fdcdf5 100644 --- a/src/unix/notbsd/linux/other/b32/mod.rs +++ b/src/unix/notbsd/linux/other/b32/mod.rs @@ -283,6 +283,61 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; +#[cfg(target_endian = "little")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }; + pub const PTRACE_GETFPREGS: ::c_uint = 14; pub const PTRACE_SETFPREGS: ::c_uint = 15; pub const PTRACE_GETREGS: ::c_uint = 12; diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs index 80ebe7e5cfc28..1b737cdb381d0 100644 --- a/src/unix/notbsd/linux/other/b64/aarch64.rs +++ b/src/unix/notbsd/linux/other/b64/aarch64.rs @@ -371,6 +371,34 @@ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8; +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + ], + }; + pub const O_DIRECT: ::c_int = 0x10000; pub const O_DIRECTORY: ::c_int = 0x4000; pub const O_NOFOLLOW: ::c_int = 0x8000; diff --git a/src/unix/notbsd/linux/other/b64/not_x32.rs b/src/unix/notbsd/linux/other/b64/not_x32.rs index fb30a31490657..b3a2114244883 100644 --- a/src/unix/notbsd/linux/other/b64/not_x32.rs +++ b/src/unix/notbsd/linux/other/b64/not_x32.rs @@ -4,6 +4,61 @@ pub type c_ulong = u64; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +#[cfg(target_endian = "little")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + // Syscall table pub const SYS_read: ::c_long = 0; diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs index 65f2fa200dc46..63c81cecceede 100644 --- a/src/unix/notbsd/linux/other/b64/powerpc64.rs +++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs @@ -358,6 +358,61 @@ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +#[cfg(target_endian = "little")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "little")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +#[cfg(target_endian = "big")] +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const O_DIRECTORY: ::c_int = 0x4000; pub const O_NOFOLLOW: ::c_int = 0x8000; pub const O_DIRECT: ::c_int = 0x20000; diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs index 206a0ce602cda..6e9713870bfa6 100644 --- a/src/unix/notbsd/linux/other/b64/sparc64.rs +++ b/src/unix/notbsd/linux/other/b64/sparc64.rs @@ -332,6 +332,31 @@ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const O_DIRECTORY: ::c_int = 0o200000; pub const O_NOFOLLOW: ::c_int = 0o400000; pub const O_DIRECT: ::c_int = 0x100000; diff --git a/src/unix/notbsd/linux/other/b64/x32.rs b/src/unix/notbsd/linux/other/b64/x32.rs index 2e97061fba7de..dd4d2029dbfa2 100644 --- a/src/unix/notbsd/linux/other/b64/x32.rs +++ b/src/unix/notbsd/linux/other/b64/x32.rs @@ -4,6 +4,31 @@ pub type c_ulong = u32; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44; +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + // Syscall table pub const __X32_SYSCALL_BIT: ::c_long = 0x40000000; diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs index 3aa2b5114fa39..543c124fdb154 100644 --- a/src/unix/notbsd/linux/s390x.rs +++ b/src/unix/notbsd/linux/s390x.rs @@ -356,6 +356,31 @@ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; +pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + ::pthread_mutex_t { + __align: [], + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const EADDRINUSE: ::c_int = 98; pub const EADDRNOTAVAIL: ::c_int = 99; pub const ECONNABORTED: ::c_int = 103;