9.12 clone

#define CLONE_PARENT 0b01
#define CLONE_THREAD 0b10

pid_t clone(void *callback, uint64_t arg, void *stack, int flags, void *tls);

This syscall creates a new thread or process depending on flags. flags can be an OR’d combination of the following flags:

This syscall returns 0 on success for the child, and the children PID or TID to the parent, in failure, the parent gets -1 with the following errno: