pid_t clone(void *sp, unsigned long flags)
If sp is non-zero, the child process uses sp as its initial stack pointer.
The low byte of flags contains the signal sent to the parent when the child dies. flags may also be bitwise-or'ed with either or both of COPYVM or COPYFD.
If COPYVM is set, child pages are copy-on-write images of the parent pages. If COPYVM is not set, the child process shares the same pages as the parent, and both parent and child may write on the same data.
If COPYFD is set, the child's file descriptors are copies of the parent's file descriptors. If COPYFD is not set, the child's file descriptors are shared with the parent. .SHRETURN VALUE On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context, no child process will be created, and errno will be set appropriately.