I would like to use function namespacing functions clone. The reading manpage seems to clonecontain a lot of complex details that I need to worry about.
clone
Is there an equivalent call clonefor good ol ' fork()?
fork()
I am already familiar with forkand believe that if I have a starting point in clone, I can add flags and options there.
fork
I think this will work, but I'm not quite sure about some pointer arguments.
pid_t child = clone( child_f, child_stack, /* int flags */ SIGCHLD, /* argument to child_f */ NULL, /* pid_t *pid */ NULL, /* struct usr_desc * tls */ NULL, /* pid_t *ctid */ NULL );
flags , , , . , , fork. , .
- fork, sys_clone, , fork.
sys_clone
fork(), unshare() .
, .
clone() . clone() fork() , clone() , - , fork() , . int (* fn) (void *) manpage - , int, .
The closest clone call is pthread_create (), which is essentially a wrapper for clone (). This will not help you get the fork () behavior.