Spawn a new process and block the parent
#include <process.h> pid_t vfork( void );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
This function spawns a new process and blocks the parent until the child process calls execve() or exits (by calling _exit() or abnormally).
A value of zero to the child process, and (later) the child's process ID in the parent. If an error occurs, no child process is created, and the function returns -1 and sets errno.
Standard Unix; removed from POSIX.1-2008
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | No |