HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
s
setclock(3C) setclock(3C)
NAME
setclock - set value of system-wide clock
SYNOPSIS
#include <sys/timers.h>
int setclock(int clock_type, struct timespec *tp);
DESCRIPTION
The setclock() function sets the current value tp of the specified system-wide clock, clock_type.
setclock() supports a clock_type of TIMEOFDAY, defined in <sys/timers.h >, which
represents the time-of-day clock for the system. For this clock, the values returned by setclock()
represent the amount of time since the Epoch.
The calling process must have appropriate privileges to set the TIMEOFDAY clock.
APPLICATION USAGE
setclock() is thread-safe and async-cancel-safe.
RETURN VALUE
Upon successful completion, setclock() returns a value of zero; otherwise it returns −1 and sets
errno to indicate the error.
ERRORS
setclock() fails if any of the following conditions are encountered:
[EINVAL] clock_type does not specify a known system-wide clock, or
tp either is outside the
range for a given clock type, or it specifies a nanosecond value less than zero or greater
than or equal to 1000 million.
[EIO] An error occurred while accessing the clock device.
[EPERM] The requesting process does not have the required appropriate privileges to set the
specified clock.
FILES
/usr/include/sys/timers.h
SEE ALSO
clocks(2), getclock(3C), gettimer(3C).
STANDARDS CONFORMANCE
setclock(): AES
Section 3−−842 − 1 − HP-UX Release 11i: December 2000
___
___