The vfork() function differs from fork() only in that the child process can share code and data with the calling process (parent process). This
speeds cloning activity significantly at a risk to the integrity of the parent process if vfork() is misused.
The use of vfork() for any purpose except as a prelude to an immediate call to a function from the exec family, or to _exit(), is not advised.
vfork() is a special case of clone(2). It is used to create new processes without copying the page tables of the parent process. It may be use‐
ful in performance-sensitive applications where a child is created which then immediately issues an execve(2).
vfork() differs from fork(2) in that the parent is suspended until the child terminates (either normally, by calling _exit(2), or abnormally,
after delivery of a fatal signal), or it makes a call to execve(2). Until that point, the child shares all memory with its parent, including the
stack. The child must not return from the current function or call exit(3), but may call _exit(2).