Skip to content

Commit c253699

Browse files
committed
Auto merge of #2744 - vityafx:add-pthread-functions-to-freebsd, r=Amanieu
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.
2 parents 5987128 + 1d5136a commit c253699

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libc-test/semver/freebsd.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,8 @@ pthread_rwlockattr_getpshared
17261726
pthread_rwlockattr_setpshared
17271727
pthread_setaffinity_np
17281728
pthread_set_name_np
1729+
pthread_getschedparam
1730+
pthread_setschedparam
17291731
pthread_spin_destroy
17301732
pthread_spin_init
17311733
pthread_spin_lock

src/unix/bsd/freebsdlike/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,16 @@ extern "C" {
15951595
pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
15961596
pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
15971597
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
1598+
pub fn pthread_setschedparam(
1599+
native: ::pthread_t,
1600+
policy: ::c_int,
1601+
param: *const sched_param,
1602+
) -> ::c_int;
1603+
pub fn pthread_getschedparam(
1604+
native: ::pthread_t,
1605+
policy: *mut ::c_int,
1606+
param: *mut sched_param,
1607+
) -> ::c_int;
15981608
pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
15991609
pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int;
16001610
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;

0 commit comments

Comments
 (0)