Marcus Thiessel <marcus(a)xemacs.org> writes:
| I believe Linux has something like this. I looked at under the
covers
| and saw the do_fork() in the kernel takes a clone_flags argument which
| can control fairly precisely what gets duplicated in the child.
I thought the clone was implemented for the use with kernel threads.
Well, my (old and outdated) 2.0 Linux system documents clone(2) in
some detail, so its use must transcend "use with kernel threads".
Hopefully it has developed since the 2.0 kernel, since the flags it
accepts appear to be quite sparse:
pid_t clone(void *sp, unsigned long flags)
DESCRIPTION
clone is an alternate interface to fork, with more
options. fork is equivalent to clone(0, SIGCLD|COPYVM).
If sp is non-zero, the child process uses sp as its iniĀ
tial stack pointer.
The low byte of flags contains the signal sent to the parĀ
ent when the child dies. flags may also be bitwise-or'ed
with either or both of COPYVM or COPYFD.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Old numerical analysts never die, they just get disarrayed.