sys/time.h是Linux系统的日期时间头文件,sys/time.h通常会包含include time.h。 编写的代码如果是平台无关的,则需要在代码里include time.h,但这样的话,使用time_t等 数据结构的话可能需要手动: #define __need_time_t #define __need_timespec 通常如果代码可以是平台相关的,则只需要include sys/time.h