Main index | Section 3 | Options |
#include <pthread_np.h>
Masks of type cpuset_t are composed using the CPU_SET macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to pthread_getaffinity_np() even if the result set would fit within the user supplied set. Calls to pthread_setaffinity_np() tolerate small sets with no restrictions.
The supplied mask should have a size of cpusetsize bytes. This size is usually provided by calling sizeof(cpuset_t) which is ultimately determined by the value of CPU_SETSIZE as defined in <sys/cpuset.h>.
pthread_getaffinity_np() retrieves the mask from the thread specified by td, and stores it in the space provided by cpusetp.
pthread_setaffinity_np() attempts to set the mask for the thread specified by td to the value in cpusetp.
[EDEADLK] | |
The pthread_setaffinity_np() call would leave a thread without a valid CPU to run on because the set does not overlap with the thread's anonymous mask. | |
[EFAULT] | |
The cpusetp pointer passed was invalid. | |
[ESRCH] | |
The thread specified by the td argument could not be found. | |
[ERANGE] | |
The cpusetsize was either preposterously large or smaller than the kernel set size. | |
[EPERM] | |
The calling thread did not have the credentials required to complete the operation. | |
PTHREAD_AFFINITY_NP (3) | March 23, 2010 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | A UNIX saleslady, Lenore, Enjoys work, but she likes the beach more. She found a good way To combine work and play: She sells C shells by the seashore. |
” |