Skip to content

Commit

Permalink
Merge pull request rust-lang#3813 from tgross35/backport-futex-constants
Browse files Browse the repository at this point in the history
[0.2] add FUTEX_WAITERS, FUTEX_OWNER_DIED and FUTEX_TID_MASK to linux
  • Loading branch information
tgross35 authored Aug 13, 2024
2 parents 0a4d4aa + 1fb493c commit de7b39b
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 @@ -824,13 +824,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 @@ -4135,6 +4135,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 @@ -4154,6 +4155,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 de7b39b

Please sign in to comment.