On 15 Dec, Martin Cracauer wrote: > Don Lewis wrote on Mon, Dec 15, 2003 at 01:28:50PM -0800: >> If you type "truss foo" at the shell prompt, the shell will fork and >> exec truss, which forks and execs foo. When truss forks, the child >> process is the one that execs foo, and the parent process watches what >> the child process does. My suggestion is to swap the roles of the >> parent and child truss processes. The parent truss process would be the >> one that calls exec(), and the child process would be the one doing the >> monitoring. When the process being traced exits, the shell would >> automagically get the correct exit status. > > Ah, OK. > > That would also have the advantage that the pid that the fork() in the > starting process gets will continue to stay correct for the child it > expects. > > E.g. > truss foo & > pid=$! > dosomethingwith $pid Like "kill -9" > pid will point to the actual process and not foo, so you can safely > insert a truss prefix where you want. I hadn't thought about it, but this is another advantage.Received on Mon Dec 15 2003 - 16:09:17 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:34 UTC