Skip to content

Commit 785e007

Browse files
committed
Auto merge of #1146 - mwanner:musl-pthread-affinity, r=gnzlbg
Add a couple pthread function definitions and get_sched for musl. I missed `pthread_setaffinity_np` for the musl variant, so I added a few missing function declarations for musl.
2 parents 530f31f + ac2cfa7 commit 785e007

File tree

1 file changed

+7
-0
lines changed
  • src/unix/notbsd/linux/musl

1 file changed

+7
-0
lines changed

src/unix/notbsd/linux/musl/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,13 @@ extern {
254254
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
255255
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
256256
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
257+
pub fn pthread_getaffinity_np(thread: ::pthread_t,
258+
cpusetsize: ::size_t,
259+
cpuset: *mut ::cpu_set_t) -> ::c_int;
260+
pub fn pthread_setaffinity_np(thread: ::pthread_t,
261+
cpusetsize: ::size_t,
262+
cpuset: *const ::cpu_set_t) -> ::c_int;
263+
pub fn sched_getcpu() -> ::c_int;
257264
}
258265

259266
cfg_if! {

0 commit comments

Comments
 (0)