summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
authorVictor Polevoy <fx@thefx.co>2022-03-26 15:57:44 +0100
committerVictor Polevoy <fx@thefx.co>2022-04-01 17:21:23 +0200
commit576f86d26f588a620240ef294994c6e9dcd9d6c2 (patch)
tree29a502c29737e4b7d5cfb14dc218ef81fa861e15 /src/unix
parentf00ea005769ba76610002b3652a5c6272ddc3633 (diff)
downloadrust-libc-576f86d26f588a620240ef294994c6e9dcd9d6c2.tar.gz
Expose more thread bindings for NetBSD-like OSes.
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/bsd/netbsdlike/mod.rs14
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs10
2 files changed, 17 insertions, 7 deletions
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index 7356e7ae23..d7b23ba4cc 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -31,6 +31,10 @@ impl ::Clone for sem {
}
s! {
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ }
+
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
@@ -724,6 +728,16 @@ extern "C" {
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_setschedparam(
+ native: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_getschedparam(
+ native: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
+ ) -> ::c_int;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn getgrouplist(
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index ef5877885f..84f17f1f13 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -487,10 +487,6 @@ s! {
af_arg: [[::c_char; 10]; 24],
}
- pub struct sched_param {
- pub sched_priority: ::c_int,
- }
-
pub struct kinfo_vmentry {
pub kve_start: u64,
pub kve_end: u64,
@@ -527,7 +523,7 @@ s! {
pub struct posix_spawnattr_t {
pub sa_flags: ::c_short,
pub sa_pgroup: ::pid_t,
- pub sa_schedparam: sched_param,
+ pub sa_schedparam: ::sched_param,
pub sa_schedpolicy: ::c_int,
pub sa_sigdefault: sigset_t,
pub sa_sigmask: sigset_t,
@@ -2516,8 +2512,8 @@ extern "C" {
) -> *mut ::c_void;
pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
- pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
- pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
pub fn sched_setscheduler(
pid: ::pid_t,