improved the handling of getrusage()