SPAWNVEG(3ast)

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 posix_spawn(3) is available, that function is preferred over fork.

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

The new process becomes a session leader.
    setsid(2) is called in the child context.

The new process is in the caller's 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), posix_spawn(3), exec(2), setpgid(2), setsid(2), spawnve(2)