posix_spawnattr_setpgroup()
Set the process group attribute in a spawn attributes object
Synopsis:
#include <spawn.h>
int posix_spawnattr_setpgroup(
posix_spawnattr_t *attrp,
pid_t pid);
Arguments:
- attrp
- A pointer to the spawn attributes object that you want to modify.
- pid
- The ID of the process group that you want the spawned process to join.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The posix_spawnattr_setpgroup() function sets the process group attribute in the spawn attributes object pointed to by attr. You must have already initialized the spawn attributes object by calling posix_spawnattr_init().
This 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; to set this flag, call the POSIX function posix_spawnattr_setflags(), or the QNX OS function posix_spawnattr_setxflags(). The default value of the process group attribute is zero. The default value of the process group attribute is zero. You can use posix_spawnattr_getpgroup(). to retrieve it.
For more information about spawn attributes, see the entry for posix_spawn().
Returns:
- EOK
- Success.
- EINVAL
- The attrp pointer does not refer to a valid attribute structure.
- ENOMEM
- There wasn't enough memory available to extend the spawn attributes object.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |