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.

The argument is currently only used if the operating system supports the posix_spawn_file_actions_addtcsetpgrp_np function. When is spawnveg will set the controlling terminal for the new process to tcfd.

CAVEATS
If the posix_spawn_file_actions_addtcsetpgrp_np function is not available, then cannot reliably 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)