Skip to content

Commit

Permalink
Auto merge of #2744 - vityafx:add-pthread-functions-to-freebsd, r=Ama…
Browse files Browse the repository at this point in the history
…nieu

Add pthread_set/get schedparam functions to FreeBSD.

FreeBSD has these functions and this provides an interface to use them.

In particular, the [`thread-priority`](https://github.com/vityafx/thread-priority/runs/5881232298) crate can't be built without those.
  • Loading branch information
bors committed Apr 10, 2022
2 parents 5987128 + 1d5136a commit c253699
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,8 @@ pthread_rwlockattr_getpshared
pthread_rwlockattr_setpshared
pthread_setaffinity_np
pthread_set_name_np
pthread_getschedparam
pthread_setschedparam
pthread_spin_destroy
pthread_spin_init
pthread_spin_lock
Expand Down
10 changes: 10 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,16 @@ extern "C" {
pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
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 ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
Expand Down

0 comments on commit c253699

Please sign in to comment.