- 论坛徽章:
- 0
|
原帖由 xuexinke 于 2006-8-15 18:35 发表
高手:小弟我用的是stime(time_t *timet),但是我用的是自己建立的一个用户,在运行程序的时候,调用函数stime对系统进行校时,但是每次都不成功,我应该怎么做。
如果任何一个用户都能随便更改时间,你认为系统会怎么样?
编译完毕,用root用户执行试试
从你提供的信息看得出来,你不喜欢检测函数的返回值,对不对?
Upon successful completion, 0 is returned. Otherwise, −1 is returned and errno is set
to indicate the error.
The stime() function will fail if:
EINVAL The tp argument points to an invalid (negative) value.
EPERM The {PRIV_SYS_TIME} privilege is not asserted in the effective set of the calling process. |
|