Set the process group attribute in a spawn attributes object
#include <spawn.h> int posix_spawnattr_setpgroup( posix_spawnattr_t *attrp, pid_t pid);
- A pointer to the spawn attributes object that you want to modify.
- The ID of the process group that you want the spawned process to join.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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 Neutrino 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().
- An argument was invalid.
- There wasn't enough memory available to extend the spawn attributes object.