clock_gettime man page on BSDOS

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDOS logo
[printable version]

CLOCK_GETTIME(3)	    BSD Programmer's Manual	      CLOCK_GETTIME(3)

NAME
     clock_gettime, clock_settime, clock_getres - get/set a POSIX clock

SYNOPSIS
     #include <time.h>

     int
     clock_gettime(clockid_t which, struct timespec *curtime);

     int
     clock_settime(clockid_t which, struct timespec *curtime);

     int
     clock_getres(clockid_t which, struct timespec *resolution);

DESCRIPTION
     The clock_gettime() function retrieves the current time as indicated by
     the clock specified by the clock identifier which. Currently, which must
     be set to CLOCK_REALTIME, as only that clock is supported.	 The result is
     returned in curtime.

     The clock_settime() function sets the value of the specified clock using
     the value in curtime.

     The CLOCK_REALTIME clock maintains the system time expressed in seconds
     and nanoseconds since midnight (0 hour), January 1, 1970.	The resolution
     of the system clock is hardware dependent, and the time may be updated
     continuously or periodically.

     The platform specific resolution supported by the clock is returned by
     the clock_getres() function.

     The structures pointed to by curtime and resolution are defined in
     <time.h> as:

     struct timespec {
	     long    tv_sec;	     /* seconds */
	     long    tv_nsec;	     /* nanoseconds */
     };

     Only the super-user may set the time of day.

RETURN
     A 0 return value indicates that the call succeeded, otherwise -1 is re-
     turned and the global variable errno is set appropriately.

ERRORS
     The clock_getres() function may fail and set errno for any of the errors
     specified for the library function sysctl(2).

     The clock_gettime() function may fail and set errno for any of the errors
     specified for the library function gettimeofday(2).

     The clock_settime() function may fail and set errno for any of the errors
     specified for the library function settimeofday(3).

SEE ALSO
     gettimeofday(2),  settimeofday(2),	 ctime(3)

4th Berkeley Distribution	  May 3, 1996				     1
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server BSDOS

List of man pages available for BSDOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net