summaryrefslogtreecommitdiffstats
path: root/vendor/libc/src/unix/linux_like
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/libc/src/unix/linux_like
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libc/src/unix/linux_like')
-rw-r--r--vendor/libc/src/unix/linux_like/android/b32/arm.rs8
-rw-r--r--vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs8
-rw-r--r--vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs33
-rw-r--r--vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs23
-rw-r--r--vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs8
-rw-r--r--vendor/libc/src/unix/linux_like/android/mod.rs18
-rw-r--r--vendor/libc/src/unix/linux_like/emscripten/mod.rs8
-rw-r--r--vendor/libc/src/unix/linux_like/linux/align.rs41
-rw-r--r--vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs4
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs21
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs7
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs1
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs1
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs1
-rw-r--r--vendor/libc/src/unix/linux_like/linux/gnu/mod.rs40
-rw-r--r--vendor/libc/src/unix/linux_like/linux/mod.rs411
-rw-r--r--vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs1
-rw-r--r--vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs1
-rw-r--r--vendor/libc/src/unix/linux_like/linux/musl/mod.rs28
-rw-r--r--vendor/libc/src/unix/linux_like/linux/no_align.rs37
-rw-r--r--vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs25
-rw-r--r--vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs27
-rw-r--r--vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs2
-rw-r--r--vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs18
-rw-r--r--vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs3
-rw-r--r--vendor/libc/src/unix/linux_like/mod.rs34
38 files changed, 725 insertions, 108 deletions
diff --git a/vendor/libc/src/unix/linux_like/android/b32/arm.rs b/vendor/libc/src/unix/linux_like/android/b32/arm.rs
index 8b8e54955..a062175ee 100644
--- a/vendor/libc/src/unix/linux_like/android/b32/arm.rs
+++ b/vendor/libc/src/unix/linux_like/android/b32/arm.rs
@@ -501,9 +501,17 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_statx: ::c_long = 397;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
// offsets in mcontext_t.gregs from sys/ucontext.h
pub const REG_R0: ::c_int = 0;
diff --git a/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs b/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
index 9545ecbfb..e549f3b51 100644
--- a/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
+++ b/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
@@ -533,9 +533,17 @@ pub const SYS_pwritev2: ::c_long = 379;
pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
diff --git a/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs b/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
index 36871b084..e7247fbb6 100644
--- a/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -107,6 +107,31 @@ pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5;
pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6;
pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7;
pub const HWCAP2_FRINT: ::c_ulong = 1 << 8;
+pub const HWCAP2_SVEI8MM: ::c_ulong = 1 << 9;
+pub const HWCAP2_SVEF32MM: ::c_ulong = 1 << 10;
+pub const HWCAP2_SVEF64MM: ::c_ulong = 1 << 11;
+pub const HWCAP2_SVEBF16: ::c_ulong = 1 << 12;
+pub const HWCAP2_I8MM: ::c_ulong = 1 << 13;
+pub const HWCAP2_BF16: ::c_ulong = 1 << 14;
+pub const HWCAP2_DGH: ::c_ulong = 1 << 15;
+pub const HWCAP2_RNG: ::c_ulong = 1 << 16;
+pub const HWCAP2_BTI: ::c_ulong = 1 << 17;
+pub const HWCAP2_MTE: ::c_ulong = 1 << 18;
+pub const HWCAP2_ECV: ::c_ulong = 1 << 19;
+pub const HWCAP2_AFP: ::c_ulong = 1 << 20;
+pub const HWCAP2_RPRES: ::c_ulong = 1 << 21;
+pub const HWCAP2_MTE3: ::c_ulong = 1 << 22;
+pub const HWCAP2_SME: ::c_ulong = 1 << 23;
+pub const HWCAP2_SME_I16I64: ::c_ulong = 1 << 24;
+pub const HWCAP2_SME_F64F64: ::c_ulong = 1 << 25;
+pub const HWCAP2_SME_I8I32: ::c_ulong = 1 << 26;
+pub const HWCAP2_SME_F16F32: ::c_ulong = 1 << 27;
+pub const HWCAP2_SME_B16F32: ::c_ulong = 1 << 28;
+pub const HWCAP2_SME_F32F32: ::c_ulong = 1 << 29;
+pub const HWCAP2_SME_FA64: ::c_ulong = 1 << 30;
+pub const HWCAP2_WFXT: ::c_ulong = 1 << 31;
+pub const HWCAP2_EBF16: ::c_ulong = 1 << 32;
+pub const HWCAP2_SVE_EBF16: ::c_ulong = 1 << 33;
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
@@ -374,9 +399,17 @@ pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
pub const SYS_syscalls: ::c_long = 436;
cfg_if! {
diff --git a/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs b/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
index 2421792cf..9d414dc15 100644
--- a/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
@@ -60,12 +60,12 @@ pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
// From NDK's asm/hwcap.h
-pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << ('I' - 'A');
-pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << ('M' - 'A');
-pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << ('A' - 'A');
-pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << ('F' - 'A');
-pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << ('D' - 'A');
-pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << ('C' - 'A');
+pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << (b'I' - b'A');
+pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << (b'M' - b'A');
+pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << (b'A' - b'A');
+pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << (b'F' - b'A');
+pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << (b'D' - b'A');
+pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << (b'C' - b'A');
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
@@ -332,6 +332,17 @@ pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
pub const SYS_syscalls: ::c_long = 436;
cfg_if! {
diff --git a/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs b/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
index 1e3ee31c5..be6b5011c 100644
--- a/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
@@ -728,9 +728,17 @@ pub const SYS_pwritev2: ::c_long = 328;
pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_statx: ::c_long = 332;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
diff --git a/vendor/libc/src/unix/linux_like/android/mod.rs b/vendor/libc/src/unix/linux_like/android/mod.rs
index adec24a0a..ca2938ac2 100644
--- a/vendor/libc/src/unix/linux_like/android/mod.rs
+++ b/vendor/libc/src/unix/linux_like/android/mod.rs
@@ -2121,6 +2121,10 @@ pub const PT_HIOS: u32 = 0x6fffffff;
pub const PT_LOPROC: u32 = 0x70000000;
pub const PT_HIPROC: u32 = 0x7fffffff;
+// uapi/linux/mount.h
+pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
+pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
+
// linux/netfilter.h
pub const NF_DROP: ::c_int = 0;
pub const NF_ACCEPT: ::c_int = 1;
@@ -2728,6 +2732,18 @@ pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000;
pub const CLONE_PIDFD: ::c_int = 0x1000;
+// linux/membarrier.h
+pub const MEMBARRIER_CMD_QUERY: ::c_int = 0;
+pub const MEMBARRIER_CMD_GLOBAL: ::c_int = 1 << 0;
+pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: ::c_int = 1 << 1;
+pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: ::c_int = 1 << 2;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: ::c_int = 1 << 3;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: ::c_int = 1 << 4;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 5;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 6;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 7;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 8;
+
// linux/mempolicy.h
pub const MPOL_DEFAULT: ::c_int = 0;
pub const MPOL_PREFERRED: ::c_int = 1;
@@ -3506,6 +3522,8 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
+
+ pub fn syncfs(fd: ::c_int) -> ::c_int;
}
cfg_if! {
diff --git a/vendor/libc/src/unix/linux_like/emscripten/mod.rs b/vendor/libc/src/unix/linux_like/emscripten/mod.rs
index f2024900c..5b947b634 100644
--- a/vendor/libc/src/unix/linux_like/emscripten/mod.rs
+++ b/vendor/libc/src/unix/linux_like/emscripten/mod.rs
@@ -1119,6 +1119,7 @@ pub const PR_SET_MM_MAP: ::c_int = 14;
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
@@ -1724,7 +1725,7 @@ f! {
pub fn major(dev: ::dev_t) -> ::c_uint {
// see
// https://github.com/emscripten-core/emscripten/blob/
- // master/system/include/libc/sys/sysmacros.h
+ // main/system/lib/libc/musl/include/sys/sysmacros.h
let mut major = 0;
major |= (dev & 0x00000fff) >> 8;
major |= (dev & 0xfffff000) >> 31 >> 1;
@@ -1734,7 +1735,7 @@ f! {
pub fn minor(dev: ::dev_t) -> ::c_uint {
// see
// https://github.com/emscripten-core/emscripten/blob/
- // master/system/include/libc/sys/sysmacros.h
+ // main/system/lib/libc/musl/include/sys/sysmacros.h
let mut minor = 0;
minor |= (dev & 0x000000ff) >> 0;
minor |= (dev & 0xffffff00) >> 12;
@@ -1814,7 +1815,6 @@ extern "C" {
) -> ::c_int;
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
- // Not available now on Android
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
@@ -1882,6 +1882,8 @@ extern "C" {
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
+
+ pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
}
cfg_if! {
diff --git a/vendor/libc/src/unix/linux_like/linux/align.rs b/vendor/libc/src/unix/linux_like/linux/align.rs
index 3a3277f29..cd4bbc721 100644
--- a/vendor/libc/src/unix/linux_like/linux/align.rs
+++ b/vendor/libc/src/unix/linux_like/linux/align.rs
@@ -28,9 +28,10 @@ macro_rules! expand_align {
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
- #[cfg_attr(any(target_env = "musl", target_pointer_width = "32"),
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(not(target_env = "musl"),
+ not(target_env = "ohos"),
target_pointer_width = "64"),
repr(align(8)))]
pub struct pthread_rwlockattr_t {
@@ -44,6 +45,12 @@ macro_rules! expand_align {
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
+ #[repr(align(4))]
+ pub struct pthread_barrierattr_t {
+ #[doc(hidden)]
+ size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
+ }
+
#[repr(align(8))]
pub struct fanotify_event_metadata {
pub event_len: __u32,
@@ -57,16 +64,16 @@ macro_rules! expand_align {
}
s_no_extra_traits! {
- #[cfg_attr(all(target_env = "musl",
+ #[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
target_pointer_width = "32"),
repr(align(4)))]
- #[cfg_attr(all(target_env = "musl",
+ #[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
target_pointer_width = "64"),
repr(align(8)))]
- #[cfg_attr(all(not(target_env = "musl"),
+ #[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
target_arch = "x86"),
repr(align(4)))]
- #[cfg_attr(all(not(target_env = "musl"),
+ #[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
not(target_arch = "x86")),
repr(align(8)))]
pub struct pthread_cond_t {
@@ -123,6 +130,30 @@ macro_rules! expand_align {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
+ #[cfg_attr(all(target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "hexagon",
+ target_arch = "m68k",
+ target_arch = "powerpc",
+ target_arch = "sparc",
+ target_arch = "x86_64",
+ target_arch = "x86")),
+ repr(align(4)))]
+ #[cfg_attr(any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "hexagon",
+ target_arch = "m68k",
+ target_arch = "powerpc",
+ target_arch = "sparc",
+ target_arch = "x86_64",
+ target_arch = "x86"))),
+ repr(align(8)))]
+ pub struct pthread_barrier_t {
+ size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
+ }
+
// linux/can.h
#[repr(align(8))]
#[allow(missing_debug_implementations)]
diff --git a/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs b/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
index 40bc30a4f..cffe748de 100644
--- a/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -95,7 +95,7 @@ cfg_if! {
if #[cfg(all(any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "aarch64"),
- not(target_env = "musl")))] {
+ not(any(target_env = "musl", target_env = "ohos"))))] {
pub const SO_TIMESTAMP_NEW: ::c_int = 63;
pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
@@ -252,7 +252,7 @@ cfg_if! {
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
- } else if #[cfg(target_env = "musl")] {
+ } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
index e0ac0dfc3..ea905eb7c 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -191,6 +191,27 @@ s! {
pub arm_cpsr: ::c_ulong,
pub fault_address: ::c_ulong,
}
+
+ pub struct user_regs {
+ pub arm_r0: ::c_ulong,
+ pub arm_r1: ::c_ulong,
+ pub arm_r2: ::c_ulong,
+ pub arm_r3: ::c_ulong,
+ pub arm_r4: ::c_ulong,
+ pub arm_r5: ::c_ulong,
+ pub arm_r6: ::c_ulong,
+ pub arm_r7: ::c_ulong,
+ pub arm_r8: ::c_ulong,
+ pub arm_r9: ::c_ulong,
+ pub arm_r10: ::c_ulong,
+ pub arm_fp: ::c_ulong,
+ pub arm_ip: ::c_ulong,
+ pub arm_sp: ::c_ulong,
+ pub arm_lr: ::c_ulong,
+ pub arm_pc: ::c_ulong,
+ pub arm_cpsr: ::c_ulong,
+ pub arm_orig_r0: ::c_ulong,
+ }
}
pub const VEOF: usize = 4;
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
index 3b78f181c..69725ee7c 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
@@ -5,7 +5,7 @@ s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
- pub sa_flags: ::c_ulong,
+ pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
}
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
index ad0d64c51..66d1d016f 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
@@ -163,8 +163,10 @@ pub const F_OFD_SETLKW: ::c_int = 38;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
cfg_if! {
if #[cfg(target_arch = "sparc")] {
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
index 827f85e86..6e3130324 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
@@ -335,6 +335,7 @@ pub const TCSAFLUSH: ::c_int = 2;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: ::c_int = 16384;
pub const O_DIRECTORY: ::c_int = 65536;
pub const O_NOFOLLOW: ::c_int = 131072;
@@ -452,6 +453,7 @@ pub const FLUSHO: ::tcflag_t = 4096;
pub const EXTPROC: ::tcflag_t = 65536;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const NGREG: usize = 32;
pub const REG_PC: usize = 0;
pub const REG_RA: usize = 1;
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
index 24b7f4e6b..0848fb588 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
@@ -7,6 +7,8 @@ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 48;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
align_const! {
#[cfg(target_endian = "little")]
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
index 14d39e543..3802caf64 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
@@ -7,6 +7,8 @@ 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 __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
align_const! {
#[cfg(target_endian = "little")]
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
index a20a1cf68..f46ea941b 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -590,6 +590,13 @@ pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2;
pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3;
pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4;
+pub const PR_SME_SET_VL: ::c_int = 63;
+pub const PR_SME_GET_VL: ::c_int = 64;
+pub const PR_SME_VL_LEN_MAX: ::c_int = 0xffff;
+
+pub const PR_SME_SET_VL_INHERIT: ::c_ulong = 1 << 17;
+pub const PR_SME_SET_VL_ONE_EXEC: ::c_ulong = 1 << 18;
+
// Syscall table
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
index d64c353bb..af2825b60 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
@@ -193,8 +193,10 @@ s! {
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
align_const! {
#[cfg(target_endian = "little")]
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
index 0bf5084d5..66b29a8aa 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
@@ -188,8 +188,10 @@ s! {
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
align_const! {
#[cfg(target_endian = "little")]
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
index ce8ce97bb..2b225e480 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
@@ -201,6 +201,7 @@ pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const VEOF: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
@@ -402,6 +403,7 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
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 __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
align_const! {
#[cfg(target_endian = "little")]
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
index 9d022f96e..c84442f1f 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
@@ -368,6 +368,7 @@ pub const EPOLL_CLOEXEC: ::c_int = 524288;
pub const EFD_CLOEXEC: ::c_int = 524288;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: ::c_int = 16384;
pub const O_DIRECTORY: ::c_int = 65536;
pub const O_NOFOLLOW: ::c_int = 131072;
@@ -491,6 +492,7 @@ pub const FLUSHO: ::tcflag_t = 4096;
pub const EXTPROC: ::tcflag_t = 65536;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const NGREG: usize = 32;
pub const REG_PC: usize = 0;
pub const REG_RA: usize = 1;
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
index c4bae089c..c2c4f31cf 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
@@ -289,8 +289,10 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
align_const! {
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
index 9fdacfac8..2427c7a0a 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
@@ -204,6 +204,7 @@ pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const O_APPEND: ::c_int = 0x8;
pub const O_CREAT: ::c_int = 0x200;
@@ -401,6 +402,7 @@ pub const EFD_CLOEXEC: ::c_int = 0x400000;
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 __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
align_const! {
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
index d515d2231..e6307e282 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
@@ -600,6 +600,7 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: ::c_int = 0x4000;
pub const O_DIRECTORY: ::c_int = 0x10000;
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
index 35d2714ee..3831dfad9 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
@@ -22,6 +22,7 @@ s! {
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
align_const! {
#[cfg(target_endian = "little")]
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
index 807b948ef..06aa0da2d 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
@@ -22,6 +22,7 @@ s! {
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
align_const! {
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
index 98a58a2ac..dbec992f0 100644
--- a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
@@ -37,7 +37,8 @@ s! {
pub stx_dev_major: u32,
pub stx_dev_minor: u32,
pub stx_mnt_id: u64,
- __statx_pad2: u64,
+ pub stx_dio_mem_align: u32,
+ pub stx_dio_offset_align: u32,
__statx_pad3: [u64; 12],
}
@@ -874,6 +875,10 @@ pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
pub const PTRACE_LISTEN: ::c_uint = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e;
+pub const PTRACE_SYSCALL_INFO_NONE: ::__u8 = 0;
+pub const PTRACE_SYSCALL_INFO_ENTRY: ::__u8 = 1;
+pub const PTRACE_SYSCALL_INFO_EXIT: ::__u8 = 2;
+pub const PTRACE_SYSCALL_INFO_SECCOMP: ::__u8 = 3;
// linux/fs.h
@@ -1018,6 +1023,7 @@ pub const STATX_BLOCKS: ::c_uint = 0x0400;
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
pub const STATX_BTIME: ::c_uint = 0x0800;
pub const STATX_MNT_ID: ::c_uint = 0x1000;
+pub const STATX_DIOALIGN: ::c_uint = 0x2000;
pub const STATX_ALL: ::c_uint = 0x0fff;
pub const STATX__RESERVED: ::c_int = 0x80000000;
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
@@ -1206,14 +1212,6 @@ extern "C" {
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
- pub fn copy_file_range(
- fd_in: ::c_int,
- off_in: *mut ::off64_t,
- fd_out: ::c_int,
- off_out: *mut ::off64_t,
- len: ::size_t,
- flags: ::c_uint,
- ) -> ::ssize_t;
pub fn fanotify_mark(
fd: ::c_int,
flags: ::c_uint,
@@ -1373,6 +1371,30 @@ extern "C" {
pub fn gnu_get_libc_version() -> *const ::c_char;
}
+// posix/spawn.h
+extern "C" {
+ // Added in `glibc` 2.29
+ pub fn posix_spawn_file_actions_addchdir_np(
+ actions: *mut ::posix_spawn_file_actions_t,
+ path: *const ::c_char,
+ ) -> ::c_int;
+ // Added in `glibc` 2.29
+ pub fn posix_spawn_file_actions_addfchdir_np(
+ actions: *mut ::posix_spawn_file_actions_t,
+ fd: ::c_int,
+ ) -> ::c_int;
+ // Added in `glibc` 2.34
+ pub fn posix_spawn_file_actions_addclosefrom_np(
+ actions: *mut ::posix_spawn_file_actions_t,
+ from: ::c_int,
+ ) -> ::c_int;
+ // Added in `glibc` 2.35
+ pub fn posix_spawn_file_actions_addtcsetpgrp_np(
+ actions: *mut ::posix_spawn_file_actions_t,
+ tcfd: ::c_int,
+ ) -> ::c_int;
+}
+
cfg_if! {
if #[cfg(any(target_arch = "x86",
target_arch = "arm",
diff --git a/vendor/libc/src/unix/linux_like/linux/mod.rs b/vendor/libc/src/unix/linux_like/linux/mod.rs
index 9658f0744..6ac0f7092 100644
--- a/vendor/libc/src/unix/linux_like/linux/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/mod.rs
@@ -48,6 +48,9 @@ pub type name_t = u64;
pub type iconv_t = *mut ::c_void;
+// linux/sctp.h
+pub type sctp_assoc_t = ::__s32;
+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // FIXME: fill this out with a struct
impl ::Copy for fpos64_t {}
@@ -468,9 +471,9 @@ s! {
__pgrp: ::pid_t,
__sd: ::sigset_t,
__ss: ::sigset_t,
- #[cfg(target_env = "musl")]
+ #[cfg(any(target_env = "musl", target_env = "ohos"))]
__prio: ::c_int,
- #[cfg(not(target_env = "musl"))]
+ #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
__sp: ::sched_param,
__policy: ::c_int,
__pad: [::c_int; 16],
@@ -625,6 +628,63 @@ s! {
pub flag: *mut ::c_int,
pub val: ::c_int,
}
+
+ // linux/sctp.h
+
+ pub struct sctp_initmsg {
+ pub sinit_num_ostreams: ::__u16,
+ pub sinit_max_instreams: ::__u16,
+ pub sinit_max_attempts: ::__u16,
+ pub sinit_max_init_timeo: ::__u16,
+ }
+
+ pub struct sctp_sndrcvinfo {
+ pub sinfo_stream: ::__u16,
+ pub sinfo_ssn: ::__u16,
+ pub sinfo_flags: ::__u16,
+ pub sinfo_ppid: ::__u32,
+ pub sinfo_context: ::__u32,
+ pub sinfo_timetolive: ::__u32,
+ pub sinfo_tsn: ::__u32,
+ pub sinfo_cumtsn: ::__u32,
+ pub sinfo_assoc_id: ::sctp_assoc_t,
+ }
+
+ pub struct sctp_sndinfo {
+ pub snd_sid: ::__u16,
+ pub snd_flags: ::__u16,
+ pub snd_ppid: ::__u32,
+ pub snd_context: ::__u32,
+ pub snd_assoc_id: ::sctp_assoc_t,
+ }
+
+ pub struct sctp_rcvinfo {
+ pub rcv_sid: ::__u16,
+ pub rcv_ssn: ::__u16,
+ pub rcv_flags: ::__u16,
+ pub rcv_ppid: ::__u32,
+ pub rcv_tsn: ::__u32,
+ pub rcv_cumtsn: ::__u32,
+ pub rcv_context: ::__u32,
+ pub rcv_assoc_id: ::sctp_assoc_t,
+ }
+
+ pub struct sctp_nxtinfo {
+ pub nxt_sid: ::__u16,
+ pub nxt_flags: ::__u16,
+ pub nxt_ppid: ::__u32,
+ pub nxt_length: ::__u32,
+ pub nxt_assoc_id: ::sctp_assoc_t,
+ }
+
+ pub struct sctp_prinfo {
+ pub pr_policy: ::__u16,
+ pub pr_value: ::__u32,
+ }
+
+ pub struct sctp_authinfo {
+ pub auth_keynumber: ::__u16,
+ }
}
s_no_extra_traits! {
@@ -938,6 +998,28 @@ cfg_if! {
}
}
+ impl PartialEq for pthread_barrier_t {
+ fn eq(&self, other: &pthread_barrier_t) -> bool {
+ self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for pthread_barrier_t {}
+
+ impl ::fmt::Debug for pthread_barrier_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("pthread_barrier_t")
+ .field("size", &self.size)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for pthread_barrier_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.size.hash(state);
+ }
+ }
+
impl PartialEq for sockaddr_alg {
fn eq(&self, other: &sockaddr_alg) -> bool {
self.salg_family == other.salg_family
@@ -1143,7 +1225,7 @@ cfg_if! {
}
cfg_if! {
- if #[cfg(any(target_env = "gnu", target_env = "musl"))] {
+ if #[cfg(any(target_env = "gnu", target_env = "musl", target_env = "ohos"))] {
pub const ABDAY_1: ::nl_item = 0x20000;
pub const ABDAY_2: ::nl_item = 0x20001;
pub const ABDAY_3: ::nl_item = 0x20002;
@@ -1699,6 +1781,12 @@ pub const IFLA_PROP_LIST: ::c_ushort = 52;
pub const IFLA_ALT_IFNAME: ::c_ushort = 53;
pub const IFLA_PERM_ADDRESS: ::c_ushort = 54;
pub const IFLA_PROTO_DOWN_REASON: ::c_ushort = 55;
+pub const IFLA_PARENT_DEV_NAME: ::c_ushort = 56;
+pub const IFLA_PARENT_DEV_BUS_NAME: ::c_ushort = 57;
+pub const IFLA_GRO_MAX_SIZE: ::c_ushort = 58;
+pub const IFLA_TSO_MAX_SIZE: ::c_ushort = 59;
+pub const IFLA_TSO_MAX_SEGS: ::c_ushort = 60;
+pub const IFLA_ALLMULTI: ::c_ushort = 61;
pub const IFLA_INFO_UNSPEC: ::c_ushort = 0;
pub const IFLA_INFO_KIND: ::c_ushort = 1;
@@ -1761,6 +1849,18 @@ pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13;
pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14;
pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15;
+// linux/membarrier.h
+pub const MEMBARRIER_CMD_QUERY: ::c_int = 0;
+pub const MEMBARRIER_CMD_GLOBAL: ::c_int = 1 << 0;
+pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: ::c_int = 1 << 1;
+pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: ::c_int = 1 << 2;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: ::c_int = 1 << 3;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: ::c_int = 1 << 4;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 5;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 6;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 7;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 8;
+
align_const! {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
@@ -1825,6 +1925,7 @@ pub const IPC_STAT: ::c_int = 2;
pub const IPC_INFO: ::c_int = 3;
pub const MSG_STAT: ::c_int = 11;
pub const MSG_INFO: ::c_int = 12;
+pub const MSG_NOTIFICATION: ::c_int = 0x8000;
pub const MSG_NOERROR: ::c_int = 0o10000;
pub const MSG_EXCEPT: ::c_int = 0o20000;
@@ -2013,6 +2114,7 @@ pub const PR_SET_MM_MAP: ::c_int = 14;
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
@@ -2042,6 +2144,16 @@ pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
pub const PR_SET_VMA: ::c_int = 0x53564d41;
pub const PR_SET_VMA_ANON_NAME: ::c_int = 0;
+pub const PR_SCHED_CORE: ::c_int = 62;
+pub const PR_SCHED_CORE_GET: ::c_int = 0;
+pub const PR_SCHED_CORE_CREATE: ::c_int = 1;
+pub const PR_SCHED_CORE_SHARE_TO: ::c_int = 2;
+pub const PR_SCHED_CORE_SHARE_FROM: ::c_int = 3;
+pub const PR_SCHED_CORE_MAX: ::c_int = 4;
+pub const PR_SCHED_CORE_SCOPE_THREAD: ::c_int = 0;
+pub const PR_SCHED_CORE_SCOPE_THREAD_GROUP: ::c_int = 1;
+pub const PR_SCHED_CORE_SCOPE_PROCESS_GROUP: ::c_int = 2;
+
pub const GRND_NONBLOCK: ::c_uint = 0x0001;
pub const GRND_RANDOM: ::c_uint = 0x0002;
pub const GRND_INSECURE: ::c_uint = 0x0004;
@@ -3132,6 +3244,10 @@ pub const IN_ALL_EVENTS: u32 = IN_ACCESS
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
+// uapi/linux/mount.h
+pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
+pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
+
// uapi/linux/netfilter/nf_tables.h
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
@@ -3413,6 +3529,27 @@ pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+pub const FUTEX_BITSET_MATCH_ANY: ::c_int = 0xffffffff;
+
+pub const FUTEX_OP_SET: ::c_int = 0;
+pub const FUTEX_OP_ADD: ::c_int = 1;
+pub const FUTEX_OP_OR: ::c_int = 2;
+pub const FUTEX_OP_ANDN: ::c_int = 3;
+pub const FUTEX_OP_XOR: ::c_int = 4;
+
+pub const FUTEX_OP_OPARG_SHIFT: ::c_int = 8;
+
+pub const FUTEX_OP_CMP_EQ: ::c_int = 0;
+pub const FUTEX_OP_CMP_NE: ::c_int = 1;
+pub const FUTEX_OP_CMP_LT: ::c_int = 2;
+pub const FUTEX_OP_CMP_LE: ::c_int = 3;
+pub const FUTEX_OP_CMP_GT: ::c_int = 4;
+pub const FUTEX_OP_CMP_GE: ::c_int = 5;
+
+pub fn FUTEX_OP(op: ::c_int, oparg: ::c_int, cmp: ::c_int, cmparg: ::c_int) -> ::c_int {
+ ((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)
+}
+
// linux/reboot.h
pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
@@ -3587,6 +3724,82 @@ pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4;
pub const J1939_FILTER_MAX: ::c_int = 512;
+// linux/sctp.h
+pub const SCTP_FUTURE_ASSOC: ::c_int = 0;
+pub const SCTP_CURRENT_ASSOC: ::c_int = 1;
+pub const SCTP_ALL_ASSOC: ::c_int = 2;
+pub const SCTP_RTOINFO: ::c_int = 0;
+pub const SCTP_ASSOCINFO: ::c_int = 1;
+pub const SCTP_INITMSG: ::c_int = 2;
+pub const SCTP_NODELAY: ::c_int = 3;
+pub const SCTP_AUTOCLOSE: ::c_int = 4;
+pub const SCTP_SET_PEER_PRIMARY_ADDR: ::c_int = 5;
+pub const SCTP_PRIMARY_ADDR: ::c_int = 6;
+pub const SCTP_ADAPTATION_LAYER: ::c_int = 7;
+pub const SCTP_DISABLE_FRAGMENTS: ::c_int = 8;
+pub const SCTP_PEER_ADDR_PARAMS: ::c_int = 9;
+pub const SCTP_DEFAULT_SEND_PARAM: ::c_int = 10;
+pub const SCTP_EVENTS: ::c_int = 11;
+pub const SCTP_I_WANT_MAPPED_V4_ADDR: ::c_int = 12;
+pub const SCTP_MAXSEG: ::c_int = 13;
+pub const SCTP_STATUS: ::c_int = 14;
+pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 15;
+pub const SCTP_DELAYED_ACK_TIME: ::c_int = 16;
+pub const SCTP_DELAYED_ACK: ::c_int = SCTP_DELAYED_ACK_TIME;
+pub const SCTP_DELAYED_SACK: ::c_int = SCTP_DELAYED_ACK_TIME;
+pub const SCTP_CONTEXT: ::c_int = 17;
+pub const SCTP_FRAGMENT_INTERLEAVE: ::c_int = 18;
+pub const SCTP_PARTIAL_DELIVERY_POINT: ::c_int = 19;
+pub const SCTP_MAX_BURST: ::c_int = 20;
+pub const SCTP_AUTH_CHUNK: ::c_int = 21;
+pub const SCTP_HMAC_IDENT: ::c_int = 22;
+pub const SCTP_AUTH_KEY: ::c_int = 23;
+pub const SCTP_AUTH_ACTIVE_KEY: ::c_int = 24;
+pub const SCTP_AUTH_DELETE_KEY: ::c_int = 25;
+pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 26;
+pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 27;
+pub const SCTP_GET_ASSOC_NUMBER: ::c_int = 28;
+pub const SCTP_GET_ASSOC_ID_LIST: ::c_int = 29;
+pub const SCTP_AUTO_ASCONF: ::c_int = 30;
+pub const SCTP_PEER_ADDR_THLDS: ::c_int = 31;
+pub const SCTP_RECVRCVINFO: ::c_int = 32;
+pub const SCTP_RECVNXTINFO: ::c_int = 33;
+pub const SCTP_DEFAULT_SNDINFO: ::c_int = 34;
+pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 35;
+pub const SCTP_REUSE_PORT: ::c_int = 36;
+pub const SCTP_PEER_ADDR_THLDS_V2: ::c_int = 37;
+pub const SCTP_PR_SCTP_NONE: ::c_int = 0x0000;
+pub const SCTP_PR_SCTP_TTL: ::c_int = 0x0010;
+pub const SCTP_PR_SCTP_RTX: ::c_int = 0x0020;
+pub const SCTP_PR_SCTP_PRIO: ::c_int = 0x0030;
+pub const SCTP_PR_SCTP_MAX: ::c_int = SCTP_PR_SCTP_PRIO;
+pub const SCTP_PR_SCTP_MASK: ::c_int = 0x0030;
+pub const SCTP_ENABLE_RESET_STREAM_REQ: ::c_int = 0x01;
+pub const SCTP_ENABLE_RESET_ASSOC_REQ: ::c_int = 0x02;
+pub const SCTP_ENABLE_CHANGE_ASSOC_REQ: ::c_int = 0x04;
+pub const SCTP_ENABLE_STRRESET_MASK: ::c_int = 0x07;
+pub const SCTP_STREAM_RESET_INCOMING: ::c_int = 0x01;
+pub const SCTP_STREAM_RESET_OUTGOING: ::c_int = 0x02;
+
+pub const SCTP_INIT: ::c_int = 0;
+pub const SCTP_SNDRCV: ::c_int = 1;
+pub const SCTP_SNDINFO: ::c_int = 2;
+pub const SCTP_RCVINFO: ::c_int = 3;
+pub const SCTP_NXTINFO: ::c_int = 4;
+pub const SCTP_PRINFO: ::c_int = 5;
+pub const SCTP_AUTHINFO: ::c_int = 6;
+pub const SCTP_DSTADDRV4: ::c_int = 7;
+pub const SCTP_DSTADDRV6: ::c_int = 8;
+
+pub const SCTP_UNORDERED: ::c_int = 1 << 0;
+pub const SCTP_ADDR_OVER: ::c_int = 1 << 1;
+pub const SCTP_ABORT: ::c_int = 1 << 2;
+pub const SCTP_SACK_IMMEDIATELY: ::c_int = 1 << 3;
+pub const SCTP_SENDALL: ::c_int = 1 << 6;
+pub const SCTP_PR_SCTP_ALL: ::c_int = 1 << 7;
+pub const SCTP_NOTIFICATION: ::c_int = MSG_NOTIFICATION;
+pub const SCTP_EOF: ::c_int = ::MSG_FIN;
+
f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
@@ -3662,6 +3875,20 @@ f! {
set1.bits == set2.bits
}
+ pub fn SCTP_PR_INDEX(policy: ::c_int) -> ::c_int {
+ policy >> 4 - 1
+ }
+
+ pub fn SCTP_PR_POLICY(policy: ::c_int) -> ::c_int {
+ policy & SCTP_PR_SCTP_MASK
+ }
+
+ pub fn SCTP_PR_SET_POLICY(flags: &mut ::c_int, policy: ::c_int) -> () {
+ *flags &= !SCTP_PR_SCTP_MASK;
+ *flags |= policy;
+ ()
+ }
+
pub fn major(dev: ::dev_t) -> ::c_uint {
let mut major = 0;
major |= (dev & 0x00000000000fff00) >> 8;
@@ -3728,10 +3955,22 @@ safe_f! {
dev |= (minor & 0xffffff00) << 12;
dev
}
+
+ pub {const} fn SCTP_PR_TTL_ENABLED(policy: ::c_int) -> bool {
+ policy == SCTP_PR_SCTP_TTL
+ }
+
+ pub {const} fn SCTP_PR_RTX_ENABLED(policy: ::c_int) -> bool {
+ policy == SCTP_PR_SCTP_RTX
+ }
+
+ pub {const} fn SCTP_PR_PRIO_ENABLED(policy: ::c_int) -> bool {
+ policy == SCTP_PR_SCTP_PRIO
+ }
}
cfg_if! {
- if #[cfg(not(target_env = "uclibc"))] {
+ if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] {
extern "C" {
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
@@ -3750,6 +3989,13 @@ cfg_if! {
nitems: ::c_int,
sevp: *mut ::sigevent,
) -> ::c_int;
+ }
+ }
+}
+
+cfg_if! {
+ if #[cfg(not(target_env = "uclibc"))] {
+ extern "C" {
pub fn pwritev(
fd: ::c_int,
iov: *const ::iovec,
@@ -3799,8 +4045,79 @@ cfg_if! {
}
}
+// These functions are not available on OpenHarmony
+cfg_if! {
+ if #[cfg(not(target_env = "ohos"))] {
+ extern "C" {
+ // Only `getspnam_r` is implemented for musl, out of all of the reenterant
+ // functions from `shadow.h`.
+ // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h
+ pub fn getspnam_r(
+ name: *const ::c_char,
+ spbuf: *mut spwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ spbufp: *mut *mut spwd,
+ ) -> ::c_int;
+
+ pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+ pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+ pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+ pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn mq_receive(
+ mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msg_prio: *mut ::c_uint,
+ ) -> ::ssize_t;
+ pub fn mq_timedreceive(
+ mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msg_prio: *mut ::c_uint,
+ abs_timeout: *const ::timespec,
+ ) -> ::ssize_t;
+ pub fn mq_send(
+ mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msg_prio: ::c_uint,
+ ) -> ::c_int;
+ pub fn mq_timedsend(
+ mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msg_prio: ::c_uint,
+ abs_timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_setattr(
+ mqd: ::mqd_t,
+ newattr: *const ::mq_attr,
+ oldattr: *mut ::mq_attr
+ ) -> ::c_int;
+
+ pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+ pub fn pthread_mutexattr_getrobust(
+ attr: *const pthread_mutexattr_t,
+ robustness: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setrobust(
+ attr: *mut pthread_mutexattr_t,
+ robustness: ::c_int,
+ ) -> ::c_int;
+ }
+ }
+}
+
extern "C" {
- #[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")]
+ #[cfg_attr(
+ not(any(target_env = "musl", target_env = "ohos")),
+ link_name = "__xpg_strerror_r"
+ )]
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
@@ -3831,18 +4148,6 @@ extern "C" {
pub fn getspent() -> *mut spwd;
pub fn getspnam(name: *const ::c_char) -> *mut spwd;
- // Only `getspnam_r` is implemented for musl, out of all of the reenterant
- // functions from `shadow.h`.
- // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h
- pub fn getspnam_r(
- name: *const ::c_char,
- spbuf: *mut spwd,
- buf: *mut ::c_char,
- buflen: ::size_t,
- spbufp: *mut *mut spwd,
- ) -> ::c_int;
-
- pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
// System V IPC
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
@@ -3948,37 +4253,6 @@ extern "C" {
id: ::c_int,
data: *mut ::c_char,
) -> ::c_int;
- pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
- pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
- pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
- pub fn mq_receive(
- mqd: ::mqd_t,
- msg_ptr: *mut ::c_char,
- msg_len: ::size_t,
- msg_prio: *mut ::c_uint,
- ) -> ::ssize_t;
- pub fn mq_timedreceive(
- mqd: ::mqd_t,
- msg_ptr: *mut ::c_char,
- msg_len: ::size_t,
- msg_prio: *mut ::c_uint,
- abs_timeout: *const ::timespec,
- ) -> ::ssize_t;
- pub fn mq_send(
- mqd: ::mqd_t,
- msg_ptr: *const ::c_char,
- msg_len: ::size_t,
- msg_prio: ::c_uint,
- ) -> ::c_int;
- pub fn mq_timedsend(
- mqd: ::mqd_t,
- msg_ptr: *const ::c_char,
- msg_len: ::size_t,
- msg_prio: ::c_uint,
- abs_timeout: *const ::timespec,
- ) -> ::c_int;
- pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
- pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
pub fn epoll_pwait(
epfd: ::c_int,
events: *mut ::epoll_event,
@@ -4045,8 +4319,6 @@ extern "C" {
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
- pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
-
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
@@ -4150,11 +4422,28 @@ extern "C" {
attr: *mut pthread_mutexattr_t,
protocol: ::c_int,
) -> ::c_int;
- pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
+
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
+ pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_getpshared(
+ attr: *const ::pthread_barrierattr_t,
+ shared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrierattr_setpshared(
+ attr: *mut ::pthread_barrierattr_t,
+ shared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrier_init(
+ barrier: *mut pthread_barrier_t,
+ attr: *const ::pthread_barrierattr_t,
+ count: ::c_uint,
+ ) -> ::c_int;
+ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
@@ -4231,7 +4520,6 @@ extern "C" {
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
- pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
@@ -4266,14 +4554,6 @@ extern "C" {
attr: *const pthread_mutexattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
- pub fn pthread_mutexattr_getrobust(
- attr: *const pthread_mutexattr_t,
- robustness: *mut ::c_int,
- ) -> ::c_int;
- pub fn pthread_mutexattr_setrobust(
- attr: *mut pthread_mutexattr_t,
- robustness: ::c_int,
- ) -> ::c_int;
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn faccessat(
dirfd: ::c_int,
@@ -4458,13 +4738,22 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
+
+ pub fn copy_file_range(
+ fd_in: ::c_int,
+ off_in: *mut ::off64_t,
+ fd_out: ::c_int,
+ off_out: *mut ::off64_t,
+ len: ::size_t,
+ flags: ::c_uint,
+ ) -> ::ssize_t;
}
cfg_if! {
if #[cfg(target_env = "uclibc")] {
mod uclibc;
pub use self::uclibc::*;
- } else if #[cfg(target_env = "musl")] {
+ } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
mod musl;
pub use self::musl::*;
} else if #[cfg(target_env = "gnu")] {
diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
index 63824fbf5..cecd6dcab 100644
--- a/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
@@ -38,6 +38,7 @@ s! {
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
cfg_if! {
if #[cfg(any(target_arch = "x86"))] {
diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
index 573624620..9ce6a9fd3 100644
--- a/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
@@ -366,6 +366,7 @@ pub const TIOCM_DSR: ::c_int = 256;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: ::c_int = 16384;
pub const O_DIRECTORY: ::c_int = 65536;
pub const O_NOFOLLOW: ::c_int = 131072;
@@ -504,6 +505,7 @@ pub const TIOCSWINSZ: ::c_int = 21524;
pub const FIONREAD: ::c_int = 21531;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
index 34c63bc69..f437355d9 100644
--- a/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
@@ -132,6 +132,7 @@ s! {
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const SOCK_NONBLOCK: ::c_int = 2048;
diff --git a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
index 2a894a602..37a8ca2af 100644
--- a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
@@ -287,12 +287,14 @@ s_no_extra_traits! {
// FIXME: musl added paddings and adjusted
// layout in 1.2.0 but our CI is still 1.1.24.
- // So, I'm leaving some fields as comments for now.
+ // So, I'm leaving some fields as cfg for now.
// ref. https://github.com/bminor/musl/commit/
// 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392
+ //
+ // OpenHarmony uses the musl 1.2 layout.
pub struct utmpx {
pub ut_type: ::c_short,
- //__ut_pad1: ::c_short,
+ __ut_pad1: ::c_short,
pub ut_pid: ::pid_t,
pub ut_line: [::c_char; 32],
pub ut_id: [::c_char; 4],
@@ -300,15 +302,22 @@ s_no_extra_traits! {
pub ut_host: [::c_char; 256],
pub ut_exit: __exit_status,
- //#[cfg(target_endian = "little")]
+ #[cfg(target_env = "musl")]
pub ut_session: ::c_long,
- //#[cfg(target_endian = "little")]
- //__ut_pad2: ::c_long,
- //#[cfg(not(target_endian = "little"))]
- //__ut_pad2: ::c_int,
- //#[cfg(not(target_endian = "little"))]
- //pub ut_session: ::c_int,
+ #[cfg(target_env = "ohos")]
+ #[cfg(target_endian = "little")]
+ pub ut_session: ::c_int,
+ #[cfg(target_env = "ohos")]
+ #[cfg(target_endian = "little")]
+ __ut_pad2: ::c_int,
+
+ #[cfg(target_env = "ohos")]
+ #[cfg(not(target_endian = "little"))]
+ __ut_pad2: ::c_int,
+ #[cfg(target_env = "ohos")]
+ #[cfg(not(target_endian = "little"))]
+ pub ut_session: ::c_int,
pub ut_tv: ::timeval,
pub ut_addr_v6: [::c_uint; 4],
@@ -537,6 +546,7 @@ pub const SIGUNUSED: ::c_int = ::SIGSYS;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const CPU_SETSIZE: ::c_int = 128;
diff --git a/vendor/libc/src/unix/linux_like/linux/no_align.rs b/vendor/libc/src/unix/linux_like/linux/no_align.rs
index 2b5abb3be..6f5f2f7c0 100644
--- a/vendor/libc/src/unix/linux_like/linux/no_align.rs
+++ b/vendor/libc/src/unix/linux_like/linux/no_align.rs
@@ -11,7 +11,7 @@ macro_rules! expand_align {
target_arch = "riscv32",
target_arch = "loongarch64",
all(target_arch = "aarch64",
- target_env = "musl")))]
+ any(target_env = "musl", target_env = "ohos"))))]
__align: [::c_int; 0],
#[cfg(not(any(target_arch = "x86_64",
target_arch = "powerpc64",
@@ -22,15 +22,15 @@ macro_rules! expand_align {
target_arch = "riscv32",
target_arch = "loongarch64",
all(target_arch = "aarch64",
- target_env = "musl"))))]
+ any(target_env = "musl", target_env = "ohos")))))]
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
pub struct pthread_rwlockattr_t {
- #[cfg(target_env = "musl")]
+ #[cfg(any(target_env = "musl", target_env = "ohos"))]
__align: [::c_int; 0],
- #[cfg(not(target_env = "musl"))]
+ #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
}
@@ -40,6 +40,11 @@ macro_rules! expand_align {
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
+ pub struct pthread_barrierattr_t {
+ __align: [::c_int; 0],
+ size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
+ }
+
pub struct fanotify_event_metadata {
__align: [::c_long; 0],
pub event_len: __u32,
@@ -54,9 +59,9 @@ macro_rules! expand_align {
s_no_extra_traits! {
pub struct pthread_cond_t {
- #[cfg(target_env = "musl")]
+ #[cfg(any(target_env = "musl", target_env = "ohos"))]
__align: [*const ::c_void; 0],
- #[cfg(not(target_env = "musl"))]
+ #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
__align: [::c_longlong; 0],
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
}
@@ -100,6 +105,26 @@ macro_rules! expand_align {
__align: [::c_longlong; 0],
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
+
+ pub struct pthread_barrier_t {
+ #[cfg(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "m68k",
+ target_arch = "powerpc",
+ target_arch = "sparc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32")))]
+ __align: [::c_long; 0],
+ #[cfg(not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "m68k",
+ target_arch = "powerpc",
+ target_arch = "sparc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
+ __align: [::c_longlong; 0],
+ size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
+ }
}
};
}
diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
index 25125bcc9..cff82f005 100644
--- a/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
@@ -466,6 +466,7 @@ pub const POLLWRBAND: ::c_short = 0x200;
pub const POLLWRNORM: ::c_short = 0x100;
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
pub const RTLD_GLOBAL: ::c_int = 0x00100;
+pub const PIDFD_NONBLOCK: ::c_int = 0x800;
// These are typed unsigned to match sigaction
pub const SA_NOCLDSTOP: ::c_ulong = 0x1;
@@ -883,11 +884,35 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
+// FIXME: should be a `c_long` too, but a bug slipped in.
pub const SYS_statx: ::c_int = 397;
pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
pub const SYS_pidfd_open: ::c_long = 434;
pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
cfg_if! {
if #[cfg(libc_align)] {
diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
index 7f9d3c031..a5aca85a3 100644
--- a/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
@@ -623,7 +623,34 @@ pub const SYS_pwritev2: ::c_long = 4000 + 362;
pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
pub const SYS_pkey_free: ::c_long = 4000 + 365;
+pub const SYS_statx: ::c_long = 4000 + 366;
+pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424;
+pub const SYS_io_uring_setup: ::c_long = 4000 + 425;
+pub const SYS_io_uring_enter: ::c_long = 4000 + 426;
+pub const SYS_io_uring_register: ::c_long = 4000 + 427;
+pub const SYS_open_tree: ::c_long = 4000 + 428;
+pub const SYS_move_mount: ::c_long = 4000 + 429;
+pub const SYS_fsopen: ::c_long = 4000 + 430;
+pub const SYS_fsconfig: ::c_long = 4000 + 431;
+pub const SYS_fsmount: ::c_long = 4000 + 432;
+pub const SYS_fspick: ::c_long = 4000 + 433;
+pub const SYS_pidfd_open: ::c_long = 4000 + 434;
pub const SYS_clone3: ::c_long = 4000 + 435;
+pub const SYS_close_range: ::c_long = 4000 + 436;
+pub const SYS_openat2: ::c_long = 4000 + 437;
+pub const SYS_pidfd_getfd: ::c_long = 4000 + 438;
+pub const SYS_faccessat2: ::c_long = 4000 + 439;
+pub const SYS_process_madvise: ::c_long = 4000 + 440;
+pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
+pub const SYS_mount_setattr: ::c_long = 4000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
+pub const SYS_memfd_secret: ::c_long = 4000 + 447;
+pub const SYS_process_mrelease: ::c_long = 4000 + 448;
+pub const SYS_futex_waitv: ::c_long = 4000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
#[link(name = "util")]
extern "C" {
diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
index be6d2813d..8ca100fcd 100644
--- a/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
@@ -189,8 +189,10 @@ s! {
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const SYS_gettid: ::c_long = 5178; // Valid for n64
diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
index 61684094f..56bfcc5d3 100644
--- a/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
@@ -38,6 +38,8 @@ pub const O_ACCMODE: ::c_int = 3;
pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_NOATIME: ::c_int = 0x40000;
+pub const O_PATH: ::c_int = 0o010000000;
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 256;
@@ -49,9 +51,11 @@ pub const O_RSYNC: ::c_int = 0x10;
pub const O_DSYNC: ::c_int = 0x10;
pub const O_FSYNC: ::c_int = 0x10;
pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_LARGEFILE: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x80;
pub const SOCK_NONBLOCK: ::c_int = 128;
+pub const PIDFD_NONBLOCK: ::c_int = 128;
pub const EDEADLK: ::c_int = 45;
pub const ENAMETOOLONG: ::c_int = 78;
@@ -72,6 +76,7 @@ pub const EL2HLT: ::c_int = 44;
pub const EBADE: ::c_int = 50;
pub const EBADR: ::c_int = 51;
pub const EXFULL: ::c_int = 52;
+pub const FFDLY: ::c_int = 0o0100000;
pub const ENOANO: ::c_int = 53;
pub const EBADRQC: ::c_int = 54;
pub const EBADSLT: ::c_int = 55;
@@ -147,6 +152,8 @@ pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
+pub const NLDLY: ::tcflag_t = 0o0000400;
+
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
pub const SOCK_SEQPACKET: ::c_int = 5;
@@ -207,30 +214,39 @@ pub const RTLD_GLOBAL: ::c_int = 0x4;
pub const SIGSTKSZ: ::size_t = 8192;
pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const CBAUDEX: ::tcflag_t = 0o0010000;
+pub const CIBAUD: ::tcflag_t = 0o002003600000;
pub const TAB1: ::tcflag_t = 0x00000800;
pub const TAB2: ::tcflag_t = 0x00001000;
pub const TAB3: ::tcflag_t = 0x00001800;
+pub const TABDLY: ::tcflag_t = 0o0014000;
pub const CR1: ::tcflag_t = 0x00000200;
pub const CR2: ::tcflag_t = 0x00000400;
pub const CR3: ::tcflag_t = 0x00000600;
pub const FF1: ::tcflag_t = 0x00008000;
pub const BS1: ::tcflag_t = 0x00002000;
+pub const BSDLY: ::tcflag_t = 0o0020000;
pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
+pub const XTABS: ::tcflag_t = 0o0014000;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
+pub const VSWTC: usize = 7;
+pub const VTDLY: ::c_int = 0o0040000;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VDISCARD: usize = 13;
pub const VTIME: usize = 5;
pub const IXON: ::tcflag_t = 0x00000400;
pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const OLCUC: ::tcflag_t = 0o0000002;
pub const ONLCR: ::tcflag_t = 0x4;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CRDLY: ::c_int = 0o0003000;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
@@ -247,6 +263,8 @@ pub const ICANON: ::tcflag_t = 0x00000002;
pub const PENDIN: ::tcflag_t = 0x00004000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const MAP_HUGETLB: ::c_int = 0x80000;
+
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
index 43ac79296..390119e3b 100644
--- a/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
+++ b/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
@@ -330,6 +330,9 @@ pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const PIDFD_NONBLOCK: ::c_int = 04000;
cfg_if! {
if #[cfg(target_os = "l4re")] {
diff --git a/vendor/libc/src/unix/linux_like/mod.rs b/vendor/libc/src/unix/linux_like/mod.rs
index e2e73b330..db5774596 100644
--- a/vendor/libc/src/unix/linux_like/mod.rs
+++ b/vendor/libc/src/unix/linux_like/mod.rs
@@ -108,13 +108,13 @@ s! {
pub struct sched_param {
pub sched_priority: ::c_int,
- #[cfg(any(target_env = "musl", target_os = "emscripten"))]
+ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
pub sched_ss_low_priority: ::c_int,
- #[cfg(any(target_env = "musl", target_os = "emscripten"))]
+ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
pub sched_ss_repl_period: ::timespec,
- #[cfg(any(target_env = "musl", target_os = "emscripten"))]
+ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
pub sched_ss_init_budget: ::timespec,
- #[cfg(any(target_env = "musl", target_os = "emscripten"))]
+ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
pub sched_ss_max_repl: ::c_int,
}
@@ -557,7 +557,21 @@ pub const XATTR_CREATE: ::c_int = 0x1;
pub const XATTR_REPLACE: ::c_int = 0x2;
cfg_if! {
- if #[cfg(not(target_env = "uclibc"))] {
+ if #[cfg(target_env = "ohos")] {
+ pub const LC_CTYPE: ::c_int = 0;
+ pub const LC_NUMERIC: ::c_int = 1;
+ pub const LC_TIME: ::c_int = 2;
+ pub const LC_COLLATE: ::c_int = 3;
+ pub const LC_MONETARY: ::c_int = 4;
+ pub const LC_MESSAGES: ::c_int = 5;
+ pub const LC_PAPER: ::c_int = 6;
+ pub const LC_NAME: ::c_int = 7;
+ pub const LC_ADDRESS: ::c_int = 8;
+ pub const LC_TELEPHONE: ::c_int = 9;
+ pub const LC_MEASUREMENT: ::c_int = 10;
+ pub const LC_IDENTIFICATION: ::c_int = 11;
+ pub const LC_ALL: ::c_int = 12;
+ } else if #[cfg(not(target_env = "uclibc"))] {
pub const LC_CTYPE: ::c_int = 0;
pub const LC_NUMERIC: ::c_int = 1;
pub const LC_TIME: ::c_int = 2;
@@ -973,7 +987,11 @@ pub const TCP_QUICKACK: ::c_int = 12;
pub const TCP_CONGESTION: ::c_int = 13;
pub const TCP_MD5SIG: ::c_int = 14;
cfg_if! {
- if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "musl")))] {
+ if #[cfg(all(target_os = "linux", any(
+ target_env = "gnu",
+ target_env = "musl",
+ target_env = "ohos"
+ )))] {
// WARN: deprecated
pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
}
@@ -1006,6 +1024,7 @@ cfg_if! {
pub const TCP_CM_INQ: ::c_int = TCP_INQ;
// NOTE: Some CI images doesn't have this option yet.
// pub const TCP_TX_DELAY: ::c_int = 37;
+ pub const TCP_MD5SIG_MAXKEYLEN: usize = 80;
}
}
@@ -1201,6 +1220,7 @@ pub const AT_REMOVEDIR: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
pub const AT_EMPTY_PATH: ::c_int = 0x1000;
+pub const AT_RECURSIVE: ::c_int = 0x8000;
pub const LOG_CRON: ::c_int = 9 << 3;
pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
@@ -1782,6 +1802,8 @@ extern "C" {
pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+ pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
}
cfg_if! {