summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-28 19:06:29 +0000
committerbors <bors@rust-lang.org>2021-06-28 19:06:29 +0000
commitc95722c0dd26538f44186f35e158eff9369cdc6f (patch)
treee41420da2a26960a6ec2a3486b0cb58eab491a5b
parentd92e1be846de4c34e4a246380181f3c39a1a1fcd (diff)
parent972a22ec5b6db768b1f7a4f6b9ada2f255577120 (diff)
downloadrust-libc-c95722c0dd26538f44186f35e158eff9369cdc6f.tar.gz
Auto merge of #2262 - devnexen:sched_get_priority, r=Amanieu
apple sched_param api addition
-rw-r--r--libc-test/semver/apple.txt7
-rw-r--r--src/unix/bsd/apple/mod.rs26
2 files changed, 33 insertions, 0 deletions
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index b3a356c05e..71db09999b 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1768,6 +1768,10 @@ pseudo_AF_KEY
pseudo_AF_PIP
pseudo_AF_RTIP
pseudo_AF_XTP
+pthread_attr_getschedparam
+pthread_attr_setschedparam
+pthread_getschedparam
+pthread_setschedparam
pthread_cancel
pthread_condattr_getpshared
pthread_condattr_setpshared
@@ -1806,6 +1810,9 @@ sa_endpoints_t
sae_associd_t
sae_connid_t
sbrk
+sched_get_priority_max
+sched_get_priority_min
+sched_param
seekdir
segment_command
segment_command_64
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 655c4c5df4..000f3399cf 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -653,6 +653,12 @@ s! {
pub struct malloc_zone_t {
__private: [::uintptr_t; 18], // FIXME: keeping private for now
}
+
+ // sched.h
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ __opaque: [::c_char; 4],
+ }
}
s_no_extra_traits! {
@@ -3791,6 +3797,26 @@ extern "C" {
class: *mut qos_class_t,
priority: *mut ::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 pthread_getschedparam(
+ thread: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_setschedparam(
+ thread: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
pub fn thread_policy_set(
thread: thread_t,
flavor: thread_policy_flavor_t,