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 f967994
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/linux/gnu/mod.rs
Expand Up @@ -1291,6 +1291,7 @@ extern "C" {
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 mallinfo() -> ::mallinfo;
pub fn mallinfo2() -> ::mallinfo2;
pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
Expand Down

0 comments on commit f967994

Please sign in to comment.