posix_spawnattr_getpartid()

Retrieve the partition identifiers currently set in a spawn attributes object

Synopsis:

#include <spawn.h>

int posix_spawnattr_getpartid(
       const posix_spawnattr_t *_Restrict attrp,
       int *num,
       partlist_info_t plist_info[]);

Arguments:

attrp
A pointer to the spawn attributes object that you want to query.
num
A pointer to a location that specifies the number of elements in the plist_info array, and where the function can store information about the number of elements required (see below).
plist_info
An array of partlist_info_t objects (see <sys/part.h>) where the function can store information about the partitions.

Library:

libc

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

Description:

The posix_spawnattr_getpartid() function retrieves the partition IDs that are currently stored in a spawn attributes object. You must have already initialized the spawn attributes object by calling posix_spawnattr_init().

The partition association takes effect only if the POSIX_SPAWN_SETSPART flag is set in the spawn attributes; to set this flag, call posix_spawnattr_setxflags(). Setting this flag without specifying a scheduling partition may produce unintended results.

You must provide the storage for the partlist_info_t array, and you must set the value pointed to by num to be the number of elements in the list.

The function sets the value pointed to by num as follows:

To determine how many entries you need, set *num to 0 and call posix_spawnattr_getpartid(). You can then allocate enough space to retrieve all of them.

Note:
  • You can distinguish partition ID types with the PART_TYPE() macro defined in <sys/part.h>.
  • This function is a QNX Neutrino extension.

Returns:

EOK
Success.
EINVAL
An argument was invalid.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes