Skip to content

Commit

Permalink
Merge pull request #3787 from danielschemmel/futex-constants
Browse files Browse the repository at this point in the history
Add Futex Constants FUTEX_WAITERS, FUTEX_OWNER_DIED and FUTEX_TID_MASK to Linux
  • Loading branch information
tgross35 committed Aug 12, 2024
2 parents 5020c76 + 8c5c7ce commit ee9fc6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit ee9fc6e

Please sign in to comment.