锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 开源技术 / C语言开源技术 / 系统调用adjtime
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。需要全文内容也请联系孙老师。

系统调用adjtime


NAME 名称

adjtime - correct the time to allow synchronization of thesystem clock. adjtime - 更正时间以允许的同步系统时钟

SYNOPSIS 概要

#include <sys/time.h>
int adjtime(struct timeval *delta, struct timeval *olddelta);

DESCRIPTION 描述

The adjtime() function adjusts the system's notion of the current time as returned by gettimeofday(3C), advancing or retarding it by the amount of time specified in the struct timeval pointed to by delta. adjtime()函数调整当前时间的系统概念通过函数gettimeofday(3C)返回,提前或通过在结构中指定的时间内量延迟。

The adjustment is effected by speeding up (if that amount of time is positive) or slowing down (if that amount of time is negative) the system's clock by some small percentage, generally a fraction of one percent. The time is always a monotonically increasing function. A time correction from an earlier call to adjtime() may not be finished when adjtime() is called again.

该调整是通过加快(如果该时间量为正),或者通过一些小百分比的通常为百分之一的减缓(如果该时间量为负)系统时钟实现的。时间始终是一个单调递增函数。当adjtime()再次从先前的adjtime()调用时,时间校正可能无法完成。

If delta is 0, then olddelta returns the status of theeffects of the previous adjtime() call with no effect on the time correction as a result of this call. If olddelta is not a null pointer, then the structure it points to will contain, upon successful return, the number of seconds and/or microseconds still to be corrected from the earlier call. If olddelta is a null pointer, the corresponding information will not be returned.

如果增量为0,那么olddelta返回和之前的adjtime() 调用效果一样,对时间校正没有影响。如果olddelta不是空指针,则它指向包含结构,成功返回,秒数或微秒仍然从早期的调用被jiaozheng。如果olddelta是空指针,相应的信息将不予退还。

This call may be used in time servers that synchronize the clocks of computers in a local area network. Such time servers would slow down the clocks of some machines and speed up the clocks of others to bring them to the average network time.
该函数可在一个局域网的同步计算机的时间服务器一起使用。这样的时间服务器将一些机器的时钟慢下来,加快他人的时钟给他们带来平均的网络时间。

Only the super-user may adjust the time of day.The adjustment value will be silently rounded to the resolution of the system clock. 只有超级用户可以调节一天中的时间。调整值将被四舍五入为系统时钟。

RETURN VALUES 返回值

Upon successful completion, adjtime() returns 0. Otherwise, it returns -1 and sets errno to indicate the error. 成功完成后,adjtime()返回0。否则,它返回-1,并设置errno以指示错误。

ERRORS 错误

The adjtime() function will fail if: adjtime()函数失败:
EFAULT The delta or olddelta argument points outside theprocess's allocated address space, or olddelta points to a region of the process's allocated address space that is not writable.
EFAULT delta或olddelta参数点进程的分配的地址空间,或olddelta指向分配的过程的一个区域地址空间是不可写。
EINVAL The tv_usec member of delta is not within valid range (-1000000 to 1000000).
EPERM The effective user of the calling process is not super-user.
EINVAL delta的tv_usec成员不在内部有效范围(-1000000到1000000)。
EPERM 调用进程的有效用户不是超级用户。
Additionally, the adjtime() function will fail for 32-bit interfaces if: 此外,如果32位接口adjtime()函数失败:
EOVERFLOW The size of the tv_sec member of the timeval structure pointed to by olddelta is too small to contain the correct number of seconds.
EOVERFLOW timeval中的tv_sec构件的尺寸结构指向olddelta太小并且包含秒的正确数目。

SEE ALSOdate(1), gettimeofday(3C
也可以看看日期(1),函数gettimeofday(3C

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内