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 <c.heiss@proxmox.com>
  • Loading branch information
christoph-heiss committed Apr 18, 2024
1 parent dff1a71 commit 1c292ff
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ RWF_NOWAIT
RWF_SYNC
SECURITYFS_MAGIC
SELINUX_MAGIC
SIGEV_THREAD_ID
SMACK_MAGIC
SMB_SUPER_MAGIC
SOL_CAIF
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,7 @@ SHORT_INODE
SIGEV_NONE
SIGEV_SIGNAL
SIGEV_THREAD
SIGEV_THREAD_ID
SIGIO
SIGPOLL
SIGPWR
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 1c292ff

Please sign in to comment.