Manual Pages for Linux CentOS command on man pthread_attr_setaffinity_np
MyWebUniversity

Manual Pages for Linux CentOS command on man pthread_attr_setaffinity_np

PTHREADATTRSETAFFINITYNPLinux Programmer's MaPTHREADATTRSETAFFINITYNP(3)

NAME

pthreadattrsetaffinitynp, pthreadattrgetaffinitynp - set/get CPU affinity attribute in thread attributes object SYNOPSIS

#define GNUSOURCE /* See featuretestmacros(7) */

#include int pthreadattrsetaffinitynp(pthreadattrt *attr, sizet cpusetsize, const cpusett *cpuset); int pthreadattrgetaffinitynp(pthreadattrt *attr, sizet cpusetsize, cpusett *cpuset);

Compile and link with -pthread. DESCRIPTION The pthreadattrsetaffinitynp() function sets the CPU affinity mask attribute of the thread attributes object referred to by attr to the value specified in cpuset. This attribute determines the CPU affinity mask of a thread created using the thread attributes object attr. The pthreadattrgetaffinitynp() function returns the CPU affinity mask attribute of the thread attributes object referred to by attr in the buffer pointed to by cpuset. The argument cpusetsize is the length (in bytes) of the buffer pointed to by cpuset. Typically, this argument would be specified as sizeof(cpusett). For more details on CPU affinity masks, see schedsetaffinity(2). For a description of a set of macros that can be used to manipulate and inspect CPU sets, see CPUSET(3). RETURN VALUE On success, these functions return 0; on error, they return a nonzero error number. ERRORS EINVAL (pthreadattrsetaffinitynp()) cpuset specified a CPU that was outside the set supported by the kernel. (The kernel configura‐ tion option CONFIGNRCPUS defines the range of the set sup‐ ported by the kernel data type used to represent CPU sets.) EINVAL (pthreadattrgetaffinitynp()) A CPU in the affinity mask of the thread attributes object referred to by attr lies outside the range specified by cpusetsize (i.e., cpuset/cpusetsize is too small). ENOMEM (pthreadattrsetaffinitynp()) Could not allocate memory. VERSIONS These functions are provided by glibc since version 2.3.4. CONFORMING TO These functions are nonstandard GNU extensions; hence the suffix "np" (nonportable) in the names. NOTES In glibc 2.3.3 only, versions of these functions were provided that did not have a cpusetsize argument. Instead the CPU set size given to the underlying system calls was always sizeof(cpusett). SEE ALSO schedsetaffinity(2), pthreadattrinit(3), pthreadsetaffinitynp(3), cpuset(7), pthreads(7) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2010-09-10 PTHREADATTRSETAFFINITYNP(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™