⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adjtime.2

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 2
字号:
.\" SCCSID: @(#)adjtime.2	8.2	4/3/91.TH adjtime 2.SH Nameadjtime \- correct the time to allow synchronization of the system clock.SH Syntax.B #include <sys/time.h>.PP.B adjtime(delta, olddelta).br.B struct timeval *delta; .br.B struct timeval *olddelta;.SH Description.NXR "adjtime system call".NXA "gettimeofday system call" "adjtime system call".NXR "clock" "synchronizing"The.PN adjtimesystem callchanges the system time, as returned by.PN gettimeofday ,moving it backward or forward by the number of microseconds corresponding to the timeval\fIdelta\fP..PPThe time is maintained by incrementing it with a machine-dependent tickevery clock interrupt.If \fIdelta\fP is negative, the clock isslowed down by incrementing it in smaller ticks untilthe correction is made.If \fIdelta\fP is positive, a larger tickis used.Thus, the time is alwaysa monotonically increasing function.A time correction from an earlier call to .PN adjtimemay not be finished when .PN adjtimeis called again.If \fIolddelta\fP is nonzero,then the structure pointed to will contain, upon return, thenumber of microseconds still to be correctedfrom the earlier call..PPThis call can be used in time servers that synchronize the clocksof computers in a local area network.Such time servers would slow down the clocks of some machinesand speed up the clocks of others to bring them to the average network time..PPThe .PN adjtimecall is restricted to the superuser..SH NoteTime is incremented in 3906-microsecond (us) ticks on RISC and 10000 us ticks on VAX.When.PN adjtimeis called with a delta less than 1 second, time is incrementedaccording to the following table until the time is corrected:.PP.TStab(@);l l l l._.sp 4p@\fBDefault\fP@\fBFast\fP@\fBSlow\fP\fBSystem\fP@\fBIncrement\fP@\fBIncrement\fP@\fBIncrement\fP.sp 4p_.sp 4pRISC@3906 us@3921 us@3891 us.sp 4pVAX@10000 us@10001 us@9999 us.sp 4p_.TE.SH Return ValuesA return value of 0 indicates that the call succeeded.A return value of \-1 indicates that an error occurred, and in thiscase an error code is stored in the global variable \fIerrno\fP..SH DiagnosticsThe following error codes may be set in \fIerrno\fP:.TP 15[EFAULT]An argument points outside the process's allocated address space..TP 15[EPERM]The process's effective user ID is not that of the super-user..SH See Alsodate(1), gettimeofday(2)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -