Skip to content

Commit

Permalink
linux_like: unify SIGEV_THREAD_ID support
Browse files Browse the repository at this point in the history
This effectively adds the constant for musl too, as last platform of
this category.

It has been supported in musl since

  7c71792e ("add support for SIGEV_THREAD_ID timers")

and was released with v1.2.2 in January 2021.

Also double-checked that the `sigevent` struct is defined in the exact
same way.

Signed-off-by: Christoph Heiss <[email protected]>
  • Loading branch information
christoph-heiss committed Apr 18, 2024
1 parent dff1a71 commit 2fd26c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PIDFD_NONBLOCK
PR_SET_VMA
PR_SET_VMA_ANON_NAME
SOL_XDP
SIGEV_THREAD_ID
XDP_SHARED_UMEM
XDP_COPY
XDP_ZEROCOPY
Expand Down
2 changes: 0 additions & 2 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2204,8 +2204,6 @@ pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);

pub const NLA_ALIGNTO: ::c_int = 4;

pub const SIGEV_THREAD_ID: ::c_int = 4;

pub const CIBAUD: ::tcflag_t = 0o02003600000;
pub const CBAUDEX: ::tcflag_t = 0o010000;

Expand Down
2 changes: 0 additions & 2 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,6 @@ pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
pub const PF_XDP: ::c_int = AF_XDP;

pub const SIGEV_THREAD_ID: ::c_int = 4;

pub const BUFSIZ: ::c_uint = 8192;
pub const TMP_MAX: ::c_uint = 238328;
pub const FOPEN_MAX: ::c_uint = 16;
Expand Down
2 changes: 0 additions & 2 deletions src/unix/linux_like/linux/uclibc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MCL_ONFAULT: ::c_int = 0x0004;

pub const SIGEV_THREAD_ID: ::c_int = 4;

pub const AF_VSOCK: ::c_int = 40;

// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
Expand Down
5 changes: 5 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,11 @@ pub const CLD_CONTINUED: ::c_int = 6;
pub const SIGEV_SIGNAL: ::c_int = 0;
pub const SIGEV_NONE: ::c_int = 1;
pub const SIGEV_THREAD: ::c_int = 2;
cfg_if! {
if #[cfg(not(target_os = "emscripten"))] {
pub const SIGEV_THREAD_ID: ::c_int = 4;
}
}

pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
Expand Down

0 comments on commit 2fd26c6

Please sign in to comment.