settimeofday系统调用可以设置系统的秒数,以及微秒数。需要超级用户权限才能执行。
#include <sys/time.h>
int settimeofday(const struct timeval *tv, const struct timezone *tz);
返回值:出错返回-1,错误码放在errno中,正确返回0.
settimeofday系统调用可以设置系统的秒数,以及微秒数。需要超级用户权限才能执行。
#include <sys/time.h>
int settimeofday(const struct timeval *tv, const struct timezone *tz);
返回值:出错返回-1,错误码放在errno中,正确返回0.