Spawn a new process and block the parent
#include <process.h> pid_t vfork( void );
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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 .
- The system-imposed limit on the total number of processes under execution would be exceeded. This limit is determined when the system is generated.
- There isn't enough memory for the new process.
To avoid a possible deadlock situation, processes that are children in the middle of a vfork() are never sent SIGTTOU or SIGTTIN signals; rather, output or ioctls are allowed and input attempts result in an EOF indication.