Skip to content

Add Futex Constants FUTEX_WAITERS, FUTEX_OWNER_DIED and FUTEX_TID_MASK to Linux #3787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024
Merged
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
3 changes: 3 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -837,13 +837,16 @@ FUTEX_OP_OPARG_SHIFT
FUTEX_OP_OR
FUTEX_OP_SET
FUTEX_OP_XOR
FUTEX_OWNER_DIED
FUTEX_PRIVATE_FLAG
FUTEX_REQUEUE
FUTEX_TID_MASK
FUTEX_TRYLOCK_PI
FUTEX_UNLOCK_PI
FUTEX_WAIT
FUTEX_WAIT_BITSET
FUTEX_WAIT_REQUEUE_PI
FUTEX_WAITERS
FUTEX_WAKE
FUTEX_WAKE_BITSET
FUTEX_WAKE_OP
Expand Down
5 changes: 5 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4607,6 +4607,7 @@ pub const FAN_NOFD: ::c_int = -1;
pub const FAN_NOPIDFD: ::c_int = FAN_NOFD;
pub const FAN_EPIDFD: ::c_int = -2;

// linux/futex.h
pub const FUTEX_WAIT: ::c_int = 0;
pub const FUTEX_WAKE: ::c_int = 1;
pub const FUTEX_FD: ::c_int = 2;
Expand All @@ -4626,6 +4627,10 @@ 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_WAITERS: u32 = 0x80000000;
pub const FUTEX_OWNER_DIED: u32 = 0x40000000;
pub const FUTEX_TID_MASK: u32 = 0x3fffffff;

pub const FUTEX_BITSET_MATCH_ANY: ::c_int = 0xffffffff;

pub const FUTEX_OP_SET: ::c_int = 0;
Expand Down