Query: adjtime
OS: hpux
Section: 2
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
adjtime(2) System Calls Manual adjtime(2)NAMEadjtime() - correct the time to synchronize the system clockSYNOPSISDESCRIPTIONThe function adjusts the current time of the system. The time is either advanced or retarded by the amount of time specified in the pointed to by delta. The adjustment is made by applying small correctional adjustments to the value of current time that the system keeps. The time is always increasing monotonically, but at a rate slightly slower or faster than normal. A time correction for an earlier call to may not be complete when is called. The second call to stops the first call to if delta is non- NULL, but does not undo the effects of the previous call. If delta is NULL, then no time correction will be done. If olddelta is not a NULL pointer, then the structure it points to will contain, upon 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. The call to returns immediately, though its effect will continue until the whole correction is made or until modified by another call to either with a non-NULL delta or to change the system time (see Only a user with appropriate privileges can call successfully with a non-NULL delta. Any user can call with a NULL delta to report the correction left from the previous call. Limits is defined in as having at least 2 members, tv_sec (seconds) and tv_usec (microseconds). When is called, if the delta.tv_sec field is greater than 31536000 (approx. 365 days), or less than -31536000, then fails with an errno of The tv_usec field is not used in the calculations to determine the limits, and so the actual limits on adjustments are seconds. Note that the desired seconds may be negative. Since the type of the tv_sec field is (unsigned long), any negative values for tv_sec need to be cast. Any olddelta value returned by the function will be returned such that the signs of non-zero members are the same. Interaction with Other System Calls A call to change the system time terminates the correction currently in effect. A subsequent call to will return {0, 0} for the olddelta parameter. This includes system calls such as and Security Restrictions This system call requires the privilege in order to successfully usa a non-NULL delta. Processes owned by the superuser have this privi- lege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges.RETURN VALUEUpon successful completion, returns a value of 0; otherwise, it returns a value -1 and sets to indicate the error.ERRORSfails if one or more of the following is true: if the process does not have the appropriate privilege. The address specified for delta (or olddelta) is invalid. 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 alterna- tive interface should be used.EXAMPLESThe following code snippet will take the time forward 20 minutes. The following code fragment will repeatedly call a user-defined function until the adjustment requested in a previous call to (called from either the same process or another process) is completed.AUTHORwas developed by the University of California, Berkeley and AT&T.SEE ALSOdate(1), gettimeofday(2), stime(2), clock_settime(2), clocks(2), getitimer(2), setitimer(2), alarm(2), privileges(5). adjtime(2)
Related Man Pages |
---|
adjtime(2) - opensolaris |
adjtime(3) - x11r4 |
adjtime(3) - v7 |
adjtime(3) - xfree86 |
adjtime(3) - plan9 |
Similar Topics in the Unix Linux Community |
---|
Changing system time in HP-UX using perl |
Https://nutrasunnaturalgreencleanseblog.com/max-trim-365/ |