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_attr_getaffinity_np() even if the result set would fit within the user supplied set. Calls to pthread_attr_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_attr_getaffinity_np() retrieves the mask from the thread attribute object specified by pattr, and stores it in the space provided by cpusetp.
pthread_attr_setaffinity_np() sets the mask for the thread attribute object specified by pattr to the value in cpusetp.
[EINVAL] | |
The pattr or the attribute specified by it is NULL. | |
[ERANGE] | |
The cpusetsize is too small. | |
The pthread_attr_setaffinity_np() function will fail if:
[EINVAL] | |
The pattr or the attribute specified by it is NULL. | |
[EINVAL] | |
The cpusetp specified a CPU that was outside the set supported by the kernel. | |
[ERANGE] | |
The cpusetsize is too small. | |
[ENOMEM] | |
Insufficient memory exists to store the cpuset mask. | |
PTHREAD_ATTR_AFFINITY_NP (3) | June 2, 2016 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Ken Thompson was once asked by a reporter what he would have changed about Unix if he had it all to do over again. His answer: “I would spell creat with an ‘e.'” | ” |