Retrieve the partition identifiers currently set in a spawn attributes object
#include <spawn.h> int posix_spawnattr_getpartid( const posix_spawnattr_t *_Restrict attrp, int *num, partlist_info_t plist_info[]);
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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:
For example, if you provide space for four entries and set *num to 4, but there are six entries in the posix_spawnattr_t object, then the function places four entries into the structure and sets the number pointed to by num to -2.
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.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |