*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> clock_settime (3)              
Title
Content
Arch
Section
 

clock_gettime(3)

Contents


NAME    [Toc]    [Back]

       clock_gettime,  clock_settime  -  Obtains or sets the time
       for the specified clock (P1003.1b)

SYNOPSIS    [Toc]    [Back]

       #include <time.h>

       int clock_gettime ( clockid_t  clock_id,  struct  timespec
       *tp);

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


LIBRARY    [Toc]    [Back]

       Realtime Library (librt.so, librt.a)

PARAMETERS    [Toc]    [Back]

       The clock type used to obtain the time for the clock  that
       is  set.  The CLOCK_REALTIME clock is supported and represents
 the TIME-OF-DAY clock for the system.  A pointer  to
       a timespec data structure.

DESCRIPTION    [Toc]    [Back]

       The  clock_gettime  function  returns the current time (in
       seconds and nanoseconds)  for  the  specified  clock.  The
       clock_settime  function  sets  the  specified  clock.  The
       CLOCK_REALTIME clock measures the amount of  time  elapsed
       since  00:00:00:00  January  1,  1970  Greenwich Mean Time
       (GMT), otherwise known as the  Epoch.  Time  values   that
       fall  between  two  non-negative  integer multiples of the
       resolution are truncated down to the smaller  multiple  of
       the resolution.

       You  must  have superuser privileges to use the clock_settime
 function.

RETURN VALUES    [Toc]    [Back]

       On a successful call to the clock_gettime or clock_settime
       functions, a value of 0 (zero) is returned.

       On  an  unsuccessful  call,  a value of -1 is returned and
       errno is set to indicate that an error occurred.

ERRORS    [Toc]    [Back]

       The clock_gettime and clock_settime functions  fail  under
       the  following  conditions: The clock_id argument does not
       specify a known clock.  The value pointed  to  by  the  tp
       argument  to  the  clock_settime  function  is outside the
       range for the given clock_id. The tp argument specified  a
       nanosecond  value  less than zero or greater than or equal
       to 1000 million.  The requesting process does not have the
       appropriate privilege to set the specified clock.








SEE ALSO    [Toc]    [Back]

      
      
       Functions:  time(1), clock_getres(3), ctime(3), timer_gettime(3)

       Guide to Realtime Programming



                                                 clock_gettime(3)
[ Back ]
 Similar pages
Name OS Title
clock_getres Tru64 Gets the resolution for the specified clock (P1003.1b)
adjkerntz FreeBSD adjust local time CMOS clock to reflect time zone changes and keep current timezone offset for the k...
sched_setparam Tru64 Sets the scheduling parameters of the specified process (P1003.1b)
mq_setattr Tru64 Sets the mq_options attributes associated with a message queue (P1003.1b)
timer_gettime Tru64 Obtains or sets the expiration
timer_settime Tru64 Obtains or sets the expiration
clock_secs_to_ymdhms NetBSD time-of-day clock support
clock_ymdhms_to_secs NetBSD time-of-day clock support
todr_setcal NetBSD time-of-day clock support
todr_getcal NetBSD time-of-day clock support
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service