improved handling of getrusage()