pthread_cluster_get_runmask()

QNX SDP8.0C Library ReferenceAPIDeveloper

Validate a cluster name and provide its associated runmask

Synopsis:

#include <pthread.h>

int pthread_cluster_get_runmask( char const *name,
                                 _Uint64t *runmask );

Arguments:

name
The name of the cluster. The following clusters are defined in any QNX system:
  • _all — A cluster representing all CPUs.
  • _cpu-num — A single CPU cluster, where num specifies the CPU number and starts at 0.

    For example, if the CPU cluster is associated with CPU0, then you'd set this field to _cpu-0.

You can further define clusters in the startup program by configuring the -c command option. For more information on clusters, refer to the Processor affinity, clusters, runmasks, and inherit masks page in the Programmer's Guide.

runmask
NULL, or a pointer to a _Uint64t unsigned integer type where the function can store the runmask that corresponds to the cores defined in the cluster. If you set this value to NULL, then the function only validates the cluster name.

Library:

libc

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

Description:

The pthread_cluster_get_runmask() function validates the cluster indicated by name, and if runmask is a non-NULL pointer, then it writes the cluster's runmask value into the memory referred to by this pointer.

For information on getting (and setting) a thread's runmask, refer to the entry for the _NTO_TCTL_RUNMASK_GET_AND_SET command on the ThreadCtl() page.

Returns:

EOK
Success.
EINVAL
The name specified wasn't found.

Classification:

POSIX 1003.1

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