pthread_spawnattr_getrunmask_np()

QNX SDP8.0C Library ReferenceAPIDeveloper

Get the 64-bit runmask attribute from a spawn attributes object

Synopsis:

#include <spawn.h>

int pthread_spawnattr_getrunmask_np(
       const posix_spawnattr_t *_Restrict attrp,
       uint64_t *_Restrict runmask_p);

Arguments:

attrp
A pointer to the spawn attributes object that you want to query.
runmask_p
A pointer to a location where the routine can store the current 64-bit runmask.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pthread_spawnattr_getrunmask_np() routine retrieves the current 64-bit value of the runmask attribute from the given spawn attributes object. You must have already initialized this object by calling posix_spawnattr_init(). The runmask attribute indicates the processor affinity of the initial thread in the spawned process and any further threads that it creates.

This attribute is a bitmask representing the set of processors that the spawned process's threads can run on. Processor numbering starts at 0, with each processor corresponding to a bit in the runmask. For example, a runmask of 0x5 means the process's threads are restricted to CPUs 0 and 2. The default behavior is to allow the threads to run on any processor (i.e., no restrictions). For more information, read the Processor affinity, clusters, runmasks, and inherit masks discussion in the QNX OS Programmer's Guide.

To set the value of this attribute, call pthread_spawnattr_setrunmask_np().

For more information about spawn attributes, see the entry for posix_spawn().

Note:
This function is a QNX OS extension.

Returns:

EOK
Success.
EINVAL
The attrp pointer does not refer to a valid attribute structure.

Classification:

QNX OS

Safety:
Cancellation point No
Signal handler Yes
Thread Yes
Page updated: