Gets and sets the spawn-pgroup attribute of a spawn attributes object.
#include <spawn.h>
int posix_spawnattr_getpgroup(const posix_spawnattr_t *restrict attr,
pid_t *restrict pgroup);
int posix_spawnattr_setpgroup(posix_spawnattr_t *attr, pid_t pgroup);
The posix_spawnattr_getpgroup subroutine gets the value of the spawn-pgroup attribute from the attributes object referenced by attr.
The posix_spawnattr_setpgroup subroutine sets the spawn-pgroup attribute in an initialized attributes object referenced by attr.
The spawn-pgroup attribute represents the process group to be joined by the new process image in a spawn operation (if POSIX_SPAWN_SETPGROUP is set in the spawn-flags attribute). The default value of this attribute is 0.
Upon successful completion, the posix_spawnattr_getpgroup subroutine returns 0 and stores the value of the spawn-pgroup attribute of attr into the object referenced by the pgroup parameter; otherwise, an error number is returned to indicate the error.
Upon successful completion, the posix_spawnattr_setpgroup subroutine returns 0; otherwise, an error number is returned to indicate the error.
Item | Description |
---|---|
EINVAL | The value specified by attr is invalid. |
Item | Description |
---|---|
EINVAL | The value of the attribute being set is not valid. |