3 ms·
> share or copy code, data, stack, and I think file opens Sounds like linux's "clone" system call. Which is the underlying syscall which clib's fork() uses. Y
by Danieru 12y ago
> share or copy code, data, stack, and I think file opens
Sounds like linux's "clone" system call. Which is the underlying syscall which clib's fork() uses.
You can do just about anything imaginable with it: http://linux.die.net/man/2/clone http://linux.die.net/man/2/clone
For example: you could create a child process-like-thing which shares nothing but the signal handler table. No idea what that would be good for.
- caf 12y agoNot all combinations are allowed. In this specific case, if you specify CLONE_SIGHAND then you must also specify CLONE_VM (so the processes share a virtual memory space, and are essentially threads).
- Danieru 12y agoAh good catch, sorry I just skimmed the man page for an interesting sounding feature.
- dap 12y agoFor that reason, clone(2) always felt like an overgenerality -- an attempt to decompose something into orthogonal parts, most combinations of which actually don't make sense.