I just noticed this line in the getrusage man page:
Including
<sys/time.h>
is not required these days, but increases portability. (Indeed, struct timeval is defined in<sys/time.h>
)
What? Since struct rusage
contains struct timeval
as a member, surely sys/resource.h must include sys/time.h or the type would be incomplete and unusable?
How could this comment ever have made sense? How could it ever have not been necessary? How could portability have ever been helped?