> 2009/11/17 François Revol <revol@xxxxxxx>: > >> wait4(pid_t pid, int *status, int options, struct rusage *rusage) > > > { > >> pid_t waitPid = waitpid(pid, status, options); > >> - getrusage(RUSAGE_CHILDREN, rusage); > >> + if (waitPid != -1) { > >> + getrusage(RUSAGE_CHILDREN, rusage); > >> + } > > > > Hmm are you really sure it's this rusage you want ?? > > What do you mean exactly? this rusage has, at least, the fields I > need > to use. Is there more than one struct rusage? IIRC wait*() are supposed to return the rusage of the catched pid, not *all* children, as done this way. But I might be wrong, this whole rusage stuff is way confusing. François.