posix_spawnattr_getcred()

Updated: April 19, 2023

Get the user and group ID attributes from a spawn attributes object

Synopsis:

#include <spawn.h>

int posix_spawnattr_getcred(
        const posix_spawnattr_t *_Restrict attrp, 
        uid_t *_Restrict uid_p, 
        gid_t *_Restrict gid_p);

Arguments:

attrp
A pointer to the spawn attributes object that you want to query.
uid_p
A pointer to a location where the routine can store the current user ID attibute.
gid_p
A pointer to a location where the routine can store the current group ID attibute.

Library:

libc

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

Description:

The posix_spawnattr_getcred() function retrieves the current values of the credential attributes (user and group IDs) from the spawn attribute object pointed to by attrp, and stores them in the locations pointed to by uid_p and gid_p. You must have already initialized the spawn attributes object by calling posix_spawnattr_init().

These attributes are used as the user and group IDs of the child process created by a spawn operation if POSIX_SPAWN_SETCRED is set in the spawn flags; to set this flag, call posix_spawnattr_setxflags().

To set the value of these attributes, call posix_spawnattr_setcred().

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

Note: 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