I just implemented the "-f" flag in truss, to trace across fork(2),
rfork(2) and vfork(2) (the last one is not tested).

The other day I observed that there were two truss processes when I
was running "truss -f" on a Solaris box. I just thought it was a much
simpler way of implementing "-f" than the strace (on Linux) way. So 
the implementation forks truss itself for each fork of the process
being traced.

It seems to work well for the most part, except for a race condition.
The race condition happens because the child process could have gone
away before the child truss could attach to it. Any suggestions to
fix the race would be highly appreciated.

I'm guilty of running indent against the source, before I did this work.
So I can't generate a clean patch yet. But if I get good feedback on this
work, I'll clean it up and produce a patch that can be commited.

The tar ball is at:

http://sharmas.dhs.org/~adsharma/projects/freebsd/truss.tar.gz

This work could be useful to those of you thinking about implementing
threads using rfork.

        -Arun


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to