Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4206,6 +4206,7 @@ fn test_linux(target: &str) {
|| name.starts_with("EPOLL")
|| name.starts_with("F_")
|| name.starts_with("FALLOC_FL_")
|| name.starts_with("FUTEX2_")
|| name.starts_with("IFLA_")
|| name.starts_with("KEXEC_")
|| name.starts_with("MS_")
Expand Down Expand Up @@ -4359,6 +4360,9 @@ fn test_linux(target: &str) {
// FIXME(linux): Not yet implemented on sparc64
"SYS_clone3" if sparc64 => true,

// FIXME(linux): Requires >= 6.9 kernel headers.
n if (arm || ppc32) && n.starts_with("FUTEX2_") => true,

// FIXME(linux): Not defined on ARM, gnueabihf, mips, musl, PowerPC, riscv64, s390x, and sparc64.
"SYS_memfd_secret"
if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 =>
Expand Down
10 changes: 10 additions & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,14 @@ FS_IOC_GETFLAGS
FS_IOC_GETVERSION
FS_IOC_SETFLAGS
FS_IOC_SETVERSION
FUTEX2_NUMA
FUTEX2_PRIVATE
FUTEX2_SIZE_MASK
FUTEX2_SIZE_U16
FUTEX2_SIZE_U32
FUTEX2_SIZE_U64
FUTEX2_SIZE_U8
FUTEX_32
FUTEX_CLOCK_REALTIME
FUTEX_CMD_MASK
FUTEX_CMP_REQUEUE
Expand All @@ -644,6 +652,7 @@ FUTEX_REQUEUE
FUTEX_TRYLOCK_PI
FUTEX_UNLOCK_PI
FUTEX_WAIT
FUTEX_WAITV_MAX
FUTEX_WAIT_BITSET
FUTEX_WAIT_REQUEUE_PI
FUTEX_WAKE
Expand Down Expand Up @@ -3521,6 +3530,7 @@ ftell
ftello
ftruncate
ftruncate64
futex_waitv
futimens
fwrite
fwrite_unlocked
Expand Down
11 changes: 11 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,14 @@ FS_IOC_GETFLAGS
FS_IOC_GETVERSION
FS_IOC_SETFLAGS
FS_IOC_SETVERSION
FUTEX2_NUMA
FUTEX2_PRIVATE
FUTEX2_SIZE_MASK
FUTEX2_SIZE_U16
FUTEX2_SIZE_U32
FUTEX2_SIZE_U64
FUTEX2_SIZE_U8
FUTEX_32
FUTEX_BITSET_MATCH_ANY
FUTEX_CLOCK_REALTIME
FUTEX_CMD_MASK
Expand Down Expand Up @@ -938,6 +946,7 @@ FUTEX_TRYLOCK_PI
FUTEX_UNLOCK_PI
FUTEX_WAIT
FUTEX_WAITERS
FUTEX_WAITV_MAX
FUTEX_WAIT_BITSET
FUTEX_WAIT_REQUEUE_PI
FUTEX_WAKE
Expand Down Expand Up @@ -3298,6 +3307,7 @@ SYS_fstatfs
SYS_fsync
SYS_ftruncate
SYS_futex
SYS_futex_waitv
SYS_get_mempolicy
SYS_get_robust_list
SYS_getcpu
Expand Down Expand Up @@ -4111,6 +4121,7 @@ fstatvfs64
ftello64
ftok
ftruncate64
futex_waitv
genlmsghdr
getdomainname
getdtablesize
Expand Down
10 changes: 10 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2584,6 +2584,16 @@ 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 FUTEX2_SIZE_U8: c_int = 0x00;
pub const FUTEX2_SIZE_U16: c_int = 0x01;
pub const FUTEX2_SIZE_U32: c_int = 0x02;
pub const FUTEX2_SIZE_U64: c_int = 0x03;
pub const FUTEX2_NUMA: c_int = 0x04;
pub const FUTEX2_PRIVATE: c_int = FUTEX_PRIVATE_FLAG;
pub const FUTEX2_SIZE_MASK: c_int = 0x03;
pub const FUTEX_32: c_int = FUTEX2_SIZE_U32;
pub const FUTEX_WAITV_MAX: c_int = 128;

// linux/errqueue.h
pub const SO_EE_ORIGIN_NONE: u8 = 0;
pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
Expand Down
10 changes: 10 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3454,6 +3454,16 @@ 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 FUTEX2_SIZE_U8: c_int = 0x00;
pub const FUTEX2_SIZE_U16: c_int = 0x01;
pub const FUTEX2_SIZE_U32: c_int = 0x02;
pub const FUTEX2_SIZE_U64: c_int = 0x03;
pub const FUTEX2_NUMA: c_int = 0x04;
pub const FUTEX2_PRIVATE: c_int = FUTEX_PRIVATE_FLAG;
pub const FUTEX2_SIZE_MASK: c_int = 0x03;
pub const FUTEX_32: c_int = FUTEX2_SIZE_U32;
pub const FUTEX_WAITV_MAX: c_int = 128;

pub const FUTEX_WAITERS: u32 = 0x80000000;
pub const FUTEX_OWNER_DIED: u32 = 0x40000000;
pub const FUTEX_TID_MASK: u32 = 0x3fffffff;
Expand Down
8 changes: 8 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ cfg_if! {
pub len: c_ushort,
pub filter: *mut sock_filter,
}

// linux/futex.h
pub struct futex_waitv {
pub val: crate::__u64,
pub uaddr: crate::__u64,
pub flags: crate::__u32,
__reserved: Padding<crate::__u32>,
}
}
}
}
Expand Down
Loading