|
|
1.1 ! root 1: .\" Copyright (c) 1980 Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted ! 5: .\" provided that the above copyright notice and this paragraph are ! 6: .\" duplicated in all such forms and that any documentation, ! 7: .\" advertising materials, and other materials related to such ! 8: .\" distribution and use acknowledge that the software was developed ! 9: .\" by the University of California, Berkeley. The name of the ! 10: .\" University may not be used to endorse or promote products derived ! 11: .\" from this software without specific prior written permission. ! 12: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 13: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 14: .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 15: .\" ! 16: .\" @(#)adjtime.2 1.5 (Berkeley) 7/9/88 ! 17: .\" ! 18: .TH ADJTIME 2 "July 9, 1988" ! 19: .UC 6 ! 20: .SH NAME ! 21: adjtime \- correct the time to allow synchronization of the system clock ! 22: .SH SYNOPSIS ! 23: .nf ! 24: .ft B ! 25: #include <sys/time.h> ! 26: .PP ! 27: .ft B ! 28: adjtime(delta, olddelta) ! 29: struct timeval *delta; ! 30: struct timeval *olddelta; ! 31: .fi ! 32: .SH DESCRIPTION ! 33: .I Adjtime ! 34: makes small adjustments to the system time, as returned by ! 35: .IR gettimeofday (2), ! 36: advancing or retarding it ! 37: by the time specified by the timeval ! 38: \fIdelta\fP. ! 39: If \fIdelta\fP is negative, the clock is ! 40: slowed down by incrementing it more slowly than normal until ! 41: the correction is complete. ! 42: If \fIdelta\fP is positive, a larger increment than normal ! 43: is used. ! 44: The skew used to perform the correction is generally a fraction of one percent. ! 45: Thus, the time is always ! 46: a monotonically increasing function. ! 47: A time correction from an earlier call to \fIadjtime\fP ! 48: may not be finished when \fIadjtime\fP is called again. ! 49: If \fIolddelta\fP is non-zero, ! 50: then the structure pointed to will contain, upon return, the ! 51: number of microseconds still to be corrected ! 52: from the earlier call. ! 53: .PP ! 54: This call may be used by time servers that synchronize the clocks ! 55: of computers in a local area network. ! 56: Such time servers would slow down the clocks of some machines ! 57: and speed up the clocks of others to bring them to the average network time. ! 58: .PP ! 59: The call ! 60: .IR adjtime (2) ! 61: is restricted to the super-user. ! 62: .SH "RETURN VALUE ! 63: A return value of 0 indicates that the call succeeded. ! 64: A return value of \-1 indicates that an error occurred, and in this ! 65: case an error code is stored in the global variable \fIerrno\fP. ! 66: .SH "ERRORS ! 67: The following error codes may be set in \fIerrno\fP: ! 68: .TP 15 ! 69: [EFAULT] ! 70: An argument points outside the process's allocated address space. ! 71: .TP 15 ! 72: [EPERM] ! 73: The process's effective user ID is not that of the super-user. ! 74: .SH "SEE ALSO" ! 75: date(1), gettimeofday(2), timed(8), timedc(8), ! 76: .br ! 77: \fITSP: The Time Synchronization Protocol for UNIX 4.3BSD\fP, ! 78: R. Gusella and S. Zatti
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.