POSIX Non-Portable (GNU extension) option group.
More...
|
| #define | CPU_SETSIZE 32 |
| | Number of CPUs a cpu_set_t can name (GNU extension).
|
| |
| #define | CPU_ZERO(set) __cpu_zero(set) |
| | Remove every CPU from set (GNU extension).
|
| |
| #define | CPU_SET(cpu, set) |
| | Add CPU cpu to set (GNU extension).
|
| |
| #define | CPU_CLR(cpu, set) |
| | Remove CPU cpu from set (GNU extension).
|
| |
| #define | CPU_ISSET(cpu, set) (((size_t)(cpu) < CPU_SETSIZE) && (((set)->__bits[__CPU_WORD(cpu)] & __CPU_BIT(cpu)) != 0)) |
| | Test whether CPU cpu is in set (GNU extension).
|
| |
| #define | CPU_COUNT(set) __cpu_count(set) |
| | Number of CPUs in set (GNU extension).
|
| |
| #define | CPU_EQUAL(a, b) __cpu_equal(a, b) |
| | Test whether a and b name the same CPUs (GNU extension).
|
| |
|
| int | pthread_getaffinity_np (pthread_t thread, size_t cpusetsize, cpu_set_t *cpuset) |
| | Get the set of CPUs a thread may run on (GNU extension).
|
| |
| int | pthread_getname_np (pthread_t thread, char *name, size_t len) |
| | Get the name of a thread (GNU extension).
|
| |
| int | pthread_setaffinity_np (pthread_t thread, size_t cpusetsize, const cpu_set_t *cpuset) |
| | Set the CPUs a thread may run on (GNU extension).
|
| |
| int | pthread_setname_np (pthread_t thread, const char *name) |
| | Set the name of a thread (GNU extension).
|
| |
| int | pthread_timedjoin_np (pthread_t thread, void **status, const struct timespec *abstime) |
| | Wait for a thread to terminate with an absolute timeout (GNU extension).
|
| |
| int | pthread_tryjoin_np (pthread_t thread, void **status) |
| | Try to join a thread without blocking (GNU extension).
|
| |
POSIX Non-Portable (GNU extension) option group.
Covers pthread_getaffinity_np(), pthread_getname_np(), pthread_setaffinity_np(), pthread_setname_np(), pthread_timedjoin_np(), and pthread_tryjoin_np().
◆ CPU_CLR
| #define CPU_CLR |
( |
|
cpu, |
|
|
|
set |
|
) |
| |
Value:
? ((set)->__bits[__CPU_WORD(cpu)] &= ~__CPU_BIT(cpu)) \
: 0U))
#define CPU_SETSIZE
Number of CPUs a cpu_set_t can name (GNU extension).
Remove CPU cpu from set (GNU extension).
Definition at line 90 of file cpuset.h.
◆ CPU_COUNT
| #define CPU_COUNT |
( |
|
set | ) |
__cpu_count(set) |
Number of CPUs in set (GNU extension).
Definition at line 106 of file cpuset.h.
◆ CPU_EQUAL
| #define CPU_EQUAL |
( |
|
a, |
|
|
|
b |
|
) |
| __cpu_equal(a, b) |
Test whether a and b name the same CPUs (GNU extension).
Definition at line 112 of file cpuset.h.
◆ CPU_ISSET
| #define CPU_ISSET |
( |
|
cpu, |
|
|
|
set |
|
) |
| (((size_t)(cpu) < CPU_SETSIZE) && (((set)->__bits[__CPU_WORD(cpu)] & __CPU_BIT(cpu)) != 0)) |
Test whether CPU cpu is in set (GNU extension).
Definition at line 99 of file cpuset.h.
◆ CPU_SET
| #define CPU_SET |
( |
|
cpu, |
|
|
|
set |
|
) |
| |
Value:
? ((set)->__bits[__CPU_WORD(cpu)] |= __CPU_BIT(cpu)) \
: 0U))
Add CPU cpu to set (GNU extension).
Definition at line 81 of file cpuset.h.
◆ CPU_SETSIZE
◆ CPU_ZERO
| #define CPU_ZERO |
( |
|
set | ) |
__cpu_zero(set) |
Remove every CPU from set (GNU extension).
Definition at line 75 of file cpuset.h.
◆ pthread_getaffinity_np()
| int pthread_getaffinity_np |
( |
pthread_t |
thread, |
|
|
size_t |
cpusetsize, |
|
|
cpu_set_t * |
cpuset |
|
) |
| |
◆ pthread_getname_np()
| int pthread_getname_np |
( |
pthread_t |
thread, |
|
|
char * |
name, |
|
|
size_t |
len |
|
) |
| |
◆ pthread_setaffinity_np()
| int pthread_setaffinity_np |
( |
pthread_t |
thread, |
|
|
size_t |
cpusetsize, |
|
|
const cpu_set_t * |
cpuset |
|
) |
| |
Set the CPUs a thread may run on (GNU extension).
CPUs in cpuset that do not exist are ignored; at least one existing CPU must remain. Without CONFIG_SCHED_CPU_MASK only a set naming every CPU can be honored.
- Parameters
-
| thread | Thread to modify. |
| cpusetsize | Size of cpuset in bytes, at least sizeof(cpu_set_t). |
| cpuset | The CPUs thread may run on. |
- Return values
-
| 0 | on success. |
| EFAULT | if cpuset is NULL. |
| EINVAL | if cpusetsize is too small or cpuset names no existing CPU. |
| ENOTSUP | if the set cannot be honored in this configuration. |
- See also
- https://man7.org/linux/man-pages/man3/pthread_setaffinity_np.3.html
◆ pthread_setname_np()
| int pthread_setname_np |
( |
pthread_t |
thread, |
|
|
const char * |
name |
|
) |
| |
◆ pthread_timedjoin_np()
| int pthread_timedjoin_np |
( |
pthread_t |
thread, |
|
|
void ** |
status, |
|
|
const struct timespec * |
abstime |
|
) |
| |
◆ pthread_tryjoin_np()
| int pthread_tryjoin_np |
( |
pthread_t |
thread, |
|
|
void ** |
status |
|
) |
| |