Skip to content

Commit

Permalink
Add pthread_sigqueue.
Browse files Browse the repository at this point in the history
pthread_sigqueue is a gnu libc extension, however I have a use case for it,
hence why I'm adding it.
  • Loading branch information
pirocks committed Aug 13, 2022
1 parent d9eb957 commit 8f7c2d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libc-test/build.rs
Expand Up @@ -3270,6 +3270,12 @@ fn test_linux(target: &str) {
// Needs musl 1.2.3 or later.
"pthread_getname_np" if musl => true,

// pthread_sigqueue uses sigval, which was initially declared
// as a struct but should be defined as a union. However due
// to the issues described here: https://github.com/rust-lang/libc/issues/2816
// it can't be changed from struct.
"pthread_sigqueue" => true,

_ => false,
}
});
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/mod.rs
Expand Up @@ -1729,6 +1729,7 @@ extern "C" {
val: *mut ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int;
pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
pub fn clearenv() -> ::c_int;
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
Expand Down

0 comments on commit 8f7c2d3

Please sign in to comment.