rusage of an active child process?

Robin Rohlicek rohlicek at bbn.com
Mon Jan 2 08:21:50 AEST 1989


What is good way to obtain an rusage structure for an active child
process.  Both getrusage(2) and wait3(2) are most useful after the
child has terminated.  The closest I've been able to get from the
documentation is

	kill(child_pid,SIGSTOP);
	pid = wait3(&status,WNOHANG|WUNTRACED,&rusage);
	kill(child_pid,SIGCONT);

which seems to work.  It seems that it should be unnecessary to stop
the child, or is this something fundamental about the way unix handles
processes?

Any pointers would be appreciated...

Thanks,
	Robin Rohlicek.



More information about the Comp.unix.wizards mailing list