Linux Standard Base Core Specification 4.0 | ||
---|---|---|
<<< Previous | Next >>> |
sched_getaffinity() shall retrieve the affinity mask of a process.
The parameter pid specifies the ID for the process. If pid is 0, then the calling process is specified instead.
The parameter cpusetsize specifies the length of the data pointed to by mask, in bytes. Normally, this parameter is specified as sizeof(cpu_set_t).
On success, sched_getaffinity() shall return 0, and the structure pointed to by mask shall contain the affinity mask of the specified process.
On failure, sched_getaffinity()
shall return -1 and
set errno
as follows.
EFAULT | Bad address. | |
EINVAL | mask does not specify any processors that exist in the system, or cpusetsize is smaller than the kernel's affinity mask. | |
ESRCH | The specified process could not be found. |
<<< Previous | Home | Next >>> |
scanf | Up | sched_setaffinity |