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

  man pages->FreeBSD man pages -> ntp_gettime (2)              
Title
Content
Arch
Section
 

NTP_GETTIME(2)

Contents


NAME    [Toc]    [Back]

     ntp_gettime -- NTP user application interface

SYNOPSIS    [Toc]    [Back]

     #include <sys/timex.h>

     int
     ntp_gettime(struct ntptimeval *ntv);

DESCRIPTION    [Toc]    [Back]

     The time returned by ntp_gettime() is in a timespec structure, but may be
     in either microsecond (seconds and microseconds) or nanosecond (seconds
     and nanoseconds) format.  The particular format in use is determined by
     the STA_NANO bit of the status word returned by the ntp_adjtime() system
     call.  ntp_gettime() has as argument a pointer to the ntptimeval structure
 with the following members:

     struct ntptimeval {
	     struct timespec time;   /* current time (ns) (ro) */
	     long maxerror;	     /* maximum error (us) (ro) */
	     long esterror;	     /* estimated error (us) (ro) */
	     long tai;		     /* TAI-UTC offset */
	     int time_state;	     /* time status */
     };

     These are understood as:

     time	 Current time (read-only).

     maxerror	 Maximum error in microseconds (read-only).

     esterror	 Estimated error in microseconds (read-only).

     tai	 Offset in seconds between the TAI and UTC time scales.  This
		 offset is published twice a year and is an integral number of
		 seconds between TAI (which does not have leap seconds) and
		 UTC (which does).  ntpd(8) or some other agent maintains this
		 value.  A value of 0 means unknown.  As of the date of the
		 manual page, the offset is 32 seconds.

     time_state  Current time status.

RETURN VALUES    [Toc]    [Back]

     The ntp_gettime() function returns the value 0 if successful; otherwise
     the value -1 is returned and the global variable errno is set to indicate
     the error.

     Possible states of the clock are:

     TIME_OK	 Everything okay, no leap second warning.
     TIME_INS	 Positive leap second warning.	At the end of the day, an
		 additional second will be inserted after 23:59:59.
     TIME_DEL	 Negative leap second warning.	At the end of the day,
		 23:59:59 is skipped.
     TIME_OOP	 Leap second in progress.
     TIME_WAIT	 Leap second has occurred.
     TIME_ERROR  Clock not synchronized.

SEE ALSO    [Toc]    [Back]

      
      
     ntp_adjtime(2), ntpd(8)

     http://www.bipm.fr/enus/5_Scientific/c_time/time_1.html

     http://www.boulder.nist.gov/timefreq/general/faq.htm

     ftp://time.nist.gov/pub/leap-seconds.list

AUTHORS    [Toc]    [Back]

     This manual page was written by Tom Rhodes <[email protected]>.


FreeBSD 5.2.1			 June 21, 2003			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ntp_adjtime FreeBSD NTP daemon application interface
abi IRIX Application Binary Interface
gss_display_status HP-UX provide an application with the textual representation of a GSSAPI status code that can be displayed to a user
gssapi HP-UX Generic Security Service Application Programming Interface
smapi FreeBSD System Management Application Program Interface driver
gss_krb5_copy_ccache FreeBSD Generic Security Service Application Program Interface library
gss_process_context_token FreeBSD Generic Security Service Application Program Interface library
gss_release_buffer FreeBSD Generic Security Service Application Program Interface library
gss_krb5_compat_des3_mic FreeBSD Generic Security Service Application Program Interface library
gss_inquire_names_for_mech FreeBSD Generic Security Service Application Program Interface library
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service