This page refers to the clone(2), a routine similar to fork(2) except that it allows the child process to share parts of its execution context with the calling process, such as the memory space, the table of file descriptors, and the table of signal handlers.

I’ve also posted about this in 02/07/2006.

#include <sched.h>

int clone(int (*fn)(void *), void *child_stack, int flags, void *arg);

Compile with ‘-static’.

References: