Auto merge of #298 - peterhj:peterhj-pthread-affinity, r=alexcrichton

linux: Support getting and setting the cpu affinity for the current pthread.

This implements `pthread_getaffinity_np` and `pthread_setaffinity_np` for linux.
This commit is contained in:
bors 2016-05-22 10:10:54 -07:00
commit e0202b84e7

View File

@ -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! {