Skip to content

Commit

Permalink
Expose more thread bindings for NetBSD-like OSes.
Browse files Browse the repository at this point in the history
  • Loading branch information
iddm committed Mar 27, 2022
1 parent f00ea00 commit 4454b97
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ pthread_condattr_setclock
pthread_getattr_np
pthread_getaffinity_np
pthread_getname_np
pthread_getschedparam
pthread_kill
pthread_mutex_timedlock
pthread_spin_destroy
Expand All @@ -1370,6 +1371,7 @@ pthread_spin_unlock
pthread_spinlock_t
pthread_setaffinity_np
pthread_setname_np
pthread_setschedparam
ptrace
ptrace_io_desc
ptrace_lwpinfo
Expand Down
3 changes: 3 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1068,10 +1068,12 @@ pthread_attr_getstack
pthread_cancel
pthread_condattr_setclock
pthread_get_name_np
pthread_getschedparam
pthread_kill
pthread_main_np
pthread_mutex_timedlock
pthread_set_name_np
pthread_setschedparam
pthread_spin_destroy
pthread_spin_init
pthread_spin_lock
Expand Down Expand Up @@ -1099,6 +1101,7 @@ regmatch_t
regoff_t
sched_get_priority_max
sched_get_priority_min
sched_param
seed48
seed48_deterministic
seekdir
Expand Down
14 changes: 14 additions & 0 deletions src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 0 additions & 4 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4454b97

Please sign in to comment.