VMS Help  —  CRTL  clock_settime
    Sets the specified clock.

    This function is supported on OpenVMS Integrity servers and
    Alpha only.

    Format

      #include  <time.h>

      int clock_settime  (clockid_t clock_id, const struct timespec *tp);

1  –  Arguments

 clock_id

    The clock type used for the clock that is to be set. The CLOCK_
    REALTIME clock is supported and represents the TIME-OF-DAY clock
    for the system.

 tp

    A pointer to a timespec data structure.

2  –  Description

    The clock_settime function sets the specified clock, clock_id,
    to the value specified by tp. Time values that are between two
    consecutive non-negative integer multiples of the resolution of
    the specified clock are truncated down to the smaller multiple of
    the resolution.

    A clock can be systemwide (that is, visible to all processes)
    or per-process (measuring time that is meaningful only within a
    process).

    The CLOCK_REALTIME clock, defined in <time.h>, represents the
    realtime clock for the system. For this clock, the values
    specified by clock_settime and returned by clock_gettime
    represent the amount of time elapsed, in seconds and nanoseconds,
    since the Epoch. The Epoch is defined as 00:00:00:00 January 1,
    1970 Greenwich Mean Time (GMT).

    You must have OPER, LOG_IO, and SYSPRV privileges to use the
    clock_settime function.

    On success, the function returns 0.

    On failure, the function returns -1 and sets errno to indicate
    the error.

    See also clock_getres, clock_gettime, time, and ctime.

3  –  Return Values

    0                  Indicates success.
    -1                 Indicates failure; errno is set to the
                       following value:

                       o  EINVAL - The clock_id argument does not
                          specify a known clock, or the tp argument
                          is outside the range for the given clock_id
                          or specifies a nanosecond value less than 0
                          or greater than or equal to 1 billion.

                       o  EPERM - The requesting process does not
                          have the appropriate privilege to set the
                          specified clock.
Close Help