clone on Linux

rganesan-l at myrealbox.com writes:
> Coming to my actual question, I am rather desperate for pthreads support on
> Linux. [...]
> I don't know if I can help, especially since kernel patching may be
> involved, but I am willing to try if pushed in the right direction :-).
> * Where do I start? I see some clone related stuff in process.c and
> syscall.c.
You might want to take a look at SUBTERFUGUE (see subterfugue.org). It can
trace cloned processes (there are probably some bugs, but it basically works),
so you could examine it to figure out ways to add this to strace. SUBTERFUGUE
itself has in principle a superset of strace capabilities, but there are a lot
of things missing from its tracing capabilities and it's currently a lot
slower than strace.
> * Did clone support work at any point of time with any Linux 2.2* kernel?
> Are there any kernel patches floating around? Is this easier to get
> working with 2.4 kernels?
Pre-2.4 kernels will be much harder, I think. Take a look at the SUBTERFUGUE
patch page to get an idea of what's missing in pre-2.4 kernels. If it was me,
I'd stick with 2.4.
> * Is it possible to support cloned processes sanely *after* they have been
> started (by using strace -p).
I can't see why not. That's not to say that it will be easy.
--Mike