Get the user and group ID attributes from a spawn attributes object
#include <spawn.h> int posix_spawnattr_getcred( const posix_spawnattr_t *_Restrict attrp, uid_t *_Restrict uid_p, gid_t *_Restrict gid_p);
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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().
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |