SPAWNVEG(3)

NAME
spawnveg - process spawn with process group and session control

SYNOPSIS

DESCRIPTION
combines fork(2), exec(2), setpgid(2) and setsid(2) into a single call. If one of either posix_spawn(3) or vfork(2) is available, those functions are preferred over fork.

and are as in execve(2). controls the new process group and session:

The new process becomes a session leader.
    It is called in the child context.

The new process is in the callers process group.

The new process becomes a process group leader.

The new process joins the process group
    pgid.

CAVEATS
The function cannot set the terminal process group. As a result, it is incompatible with job control when used with terminals. Additionally, if the attribute is not supported, then cannot make the new process a session leader when using the posix_spawn API.

SEE ALSO
fork(2), vfork(2), posix_spawn(3), exec(2), setpgid(2), setsid(2), spawnve(2)