Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more pthread_attr functions and related constants: #3447

Merged
merged 1 commit into from Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -1986,6 +1986,8 @@ PTHREAD_PRIO_INHERIT
PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
PTHREAD_INHERIT_SCHED
PTHREAD_EXPLICIT_SCHED
PTHREAD_STACK_MIN
PTHREAD_ONCE_INIT
PTRACE_ATTACH
Expand Down Expand Up @@ -3655,6 +3657,12 @@ priority_t
pread64
preadv
pthread_attr_getguardsize
pthread_attr_getinheritsched
pthread_attr_setinheritsched
pthread_attr_getschedpolicy
pthread_attr_setschedpolicy
pthread_attr_getschedparam
pthread_attr_setschedparam
pthread_attr_getstack
pthread_attr_setguardsize
pthread_cancel
Expand Down
23 changes: 23 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -2000,6 +2000,8 @@ pub const PTHREAD_PRIO_INHERIT: ::c_int = 1;
pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const PTHREAD_INHERIT_SCHED: ::c_int = 0;
pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 1;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;

pub const RENAME_NOREPLACE: ::c_uint = 1;
Expand Down Expand Up @@ -5179,6 +5181,27 @@ extern "C" {
guardsize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
pub fn pthread_attr_getinheritsched(
attr: *const ::pthread_attr_t,
inheritsched: *mut ::c_int,
) -> ::c_int;
pub fn pthread_attr_setinheritsched(
attr: *mut ::pthread_attr_t,
inheritsched: ::c_int,
) -> ::c_int;
pub fn pthread_attr_getschedpolicy(
attr: *const ::pthread_attr_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn pthread_attr_setschedpolicy(attr: *mut ::pthread_attr_t, policy: ::c_int) -> ::c_int;
pub fn pthread_attr_getschedparam(
attr: *const ::pthread_attr_t,
param: *mut ::sched_param,
) -> ::c_int;
pub fn pthread_attr_setschedparam(
attr: *mut ::pthread_attr_t,
param: *const ::sched_param,
) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
pub fn pthread_condattr_getpshared(
Expand Down