From 0b3635fda874844388949838c5347359c4fb483e Mon Sep 17 00:00:00 2001 From: Peter Jin Date: Sat, 21 May 2016 20:50:20 -0700 Subject: [PATCH] linux: Support getting and setting the cpu affinity for the current pthread. --- src/unix/notbsd/linux/other/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs index 63a3e920..b869a89b 100644 --- a/src/unix/notbsd/linux/other/mod.rs +++ b/src/unix/notbsd/linux/other/mod.rs @@ -495,6 +495,12 @@ extern { pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t, cpusetsize: ::size_t, cpuset: *const ::cpu_set_t) -> ::c_int; + pub fn pthread_getaffinity_np(thread: ::pthread_t, + cpusetsize: ::size_t, + cpuset: *mut ::cpu_set_t) -> ::c_int; + pub fn pthread_setaffinity_np(thread: ::pthread_t, + cpusetsize: ::size_t, + cpuset: *const ::cpu_set_t) -> ::c_int; } cfg_if! {