Skip to content

Commit 972a22e

Browse files
committed
apple sched_param api addition
1 parent d92e1be commit 972a22e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,10 @@ pseudo_AF_KEY
17681768
pseudo_AF_PIP
17691769
pseudo_AF_RTIP
17701770
pseudo_AF_XTP
1771+
pthread_attr_getschedparam
1772+
pthread_attr_setschedparam
1773+
pthread_getschedparam
1774+
pthread_setschedparam
17711775
pthread_cancel
17721776
pthread_condattr_getpshared
17731777
pthread_condattr_setpshared
@@ -1806,6 +1810,9 @@ sa_endpoints_t
18061810
sae_associd_t
18071811
sae_connid_t
18081812
sbrk
1813+
sched_get_priority_max
1814+
sched_get_priority_min
1815+
sched_param
18091816
seekdir
18101817
segment_command
18111818
segment_command_64

src/unix/bsd/apple/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,12 @@ s! {
653653
pub struct malloc_zone_t {
654654
__private: [::uintptr_t; 18], // FIXME: keeping private for now
655655
}
656+
657+
// sched.h
658+
pub struct sched_param {
659+
pub sched_priority: ::c_int,
660+
__opaque: [::c_char; 4],
661+
}
656662
}
657663

658664
s_no_extra_traits! {
@@ -3791,6 +3797,26 @@ extern "C" {
37913797
class: *mut qos_class_t,
37923798
priority: *mut ::c_int,
37933799
) -> ::c_int;
3800+
pub fn pthread_attr_getschedparam(
3801+
attr: *const ::pthread_attr_t,
3802+
param: *mut sched_param,
3803+
) -> ::c_int;
3804+
pub fn pthread_attr_setschedparam(
3805+
attr: *mut ::pthread_attr_t,
3806+
param: *const sched_param,
3807+
) -> ::c_int;
3808+
pub fn pthread_getschedparam(
3809+
thread: ::pthread_t,
3810+
policy: *mut ::c_int,
3811+
param: *mut sched_param,
3812+
) -> ::c_int;
3813+
pub fn pthread_setschedparam(
3814+
thread: ::pthread_t,
3815+
policy: ::c_int,
3816+
param: *const sched_param,
3817+
) -> ::c_int;
3818+
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
3819+
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
37943820
pub fn thread_policy_set(
37953821
thread: thread_t,
37963822
flavor: thread_policy_flavor_t,

0 commit comments

Comments
 (0)