HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
a
adjtime(2) adjtime(2)
[EFAULT] The address specified for delta (or olddelta) is invalid.
[EINVAL] If delta.tv_sec is greater than 31536000 (approx. 365 days) or less than 31536000.
The delta.tv_usec field is not used in calculation of these limits. If the user wants to
adjust time greater than these limits, an appropriate alternative interface should be
used.
EXAMPLES
The following code snippet will take the time forward 20 minutes.
struct timeval forward;
forward.tv_sec = 20 * 60; /* 20 minutes */
forward.tv_usec = 0;
if (adjtime(&forward, (struct timeval *)NULL) == -1)
perror("adjtime() failure");
/*
* If adjtime() succeeds, the system time will move forward
* 20 minutes over a period of time.
*/
The following code fragment will repeatedly call a user-defined function adjustment_still_in_progress() until
the adjustment requested in a previous call to
adjtime() (called from either the same process or
another process) is completed.
struct timeval report;
if (adjtime((struct timeval *)NULL, &report) == -1)
perror("adjtime() failure");
while (report.tv_sec || report.tv_usec) {
adjustment_still_in_progress();
if (adjtime((struct timeval *)NULL, &report) == -1)
perror("adjtime() failure");
}
AUTHOR
adjtime() was developed by the University of California, Berkeley and AT&T.
SEE ALSO
date(1), gettimeofday(2), stime(2), clock_settime(2), clocks(2), getitimer(2), setitimer(2), alarm(2).
Section 210 2 HP-UX Release 11i: December 2000
___
___