On Tue, 10 Jul 2007, John Carter wrote:

I suspect all the info is there in /proc/self/status

All I need is a wee wrapper, let's for arguments sake call statusWrap that...
statusWrap command

* Looks up command on path.
* forks & execs it.
* Somehow catches the exit and before /proc/pid/status vanishes...
* cats /proc/pid/status to stderr

Shouldn't be too hard. I'd write it myself in 5 minutes 'cept I'd feel
a damn fool. This must exist on my system somewhere already...

So I thought I'd spend the 5 minutes...

The crux of the problem is to catch the child process before
/proc/pid/status disapppears.

So I started looking at "wait" calls and found wait4... Aha! It gets all the 
details I need...


Hmm... Let's strace /usr/bin/time....

Bugger.

It uses wait4 and the values are crap there already. ie. The problems
not /usr/bin/time, it's deeper in.

Ah well, let's not bother with that then...

John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : [EMAIL PROTECTED]
New Zealand

Reply via email to