Linux通过系统函数设置系统时间_代码里的settimeofday(&tv, null)函数,是需要root权限的_faihung的博客-CSDN博客

网站介绍:一、描述通过settimeofday()函数来设置系统时间,这个函数设置的精度可以精确到微秒。#include <time.h>int settimeofday(const struct timeval *tv , const struct timezone *tz);struct timeval { time_t tv_sec; suseconds_t tv_usec; _代码里的settimeofday(&tv, null)函数,是需要root权限的