How can adding a header increase portability? (sys/time.h)
问题 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? 回答1: In general, it was