Add a manual page for the ntp_gettime syscall.

Reviewed by:	ru, phk (older version).
This commit is contained in:
Tom Rhodes 2003-04-17 18:39:30 +00:00
parent e37f27be24
commit 59ac15c152
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113608
2 changed files with 106 additions and 2 deletions

View File

@ -70,8 +70,8 @@ MAN+= _exit.2 accept.2 access.2 acct.2 adjtime.2 \
kldunload.2 kqueue.2 kse.2 ktrace.2 link.2 lio_listio.2 listen.2 \
lseek.2 \
madvise.2 mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 mmap.2 \
modfind.2 modnext.2 modstat.2 \
mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 ntp_adjtime.2 \
modfind.2 modnext.2 modstat.2 mount.2 \
mprotect.2 msync.2 munmap.2 nanosleep.2 ntp_adjtime.2 ntp_gettime.2 \
nfssvc.2 open.2 pathconf.2 pipe.2 poll.2 profil.2 ptrace.2 quotactl.2 \
read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
rtprio.2 select.2 semctl.2 semget.2 semop.2 send.2 sendfile.2 \

104
lib/libc/sys/ntp_gettime.2 Normal file
View File

@ -0,0 +1,104 @@
.\"
.\" Copyright (c) 2003 Tom Rhodes
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd April 1, 2003
.Dt NTP_GETTIME 2
.Os
.Sh NAME
.Nm ntp_gettime
.Nd NTP user application interface
.Sh SYNOPSIS
.In sys/timex.h
.Ft int
.Fn ntp_gettime "struct ntptimeval *ntv"
.Sh DESCRIPTION
The time returned by
.Fn ntp_gettime
is in a
.Vt 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
.Dv STA_NANO
bit of the status
word returned by the
.Fn ntp_adjtime
system call.
.Fn ntp_gettime
has as argument a pointer to the
.Vt ntptimeval
structure with the following members:
.Bd -literal
struct ntptimeval {
struct timespec time; /* current time (ns) (ro) */
long maxerror; /* maximum error (us) (ro) */
long esterror; /* estimated error (us) (ro) */
long tai; /* TAI offset */
int time_state; /* time status */
};
.Ed
.Pp
These are understood as:
.Bl -tag -width ".Va time_state"
.It Va time
Current time (read-only).
.It Va maxerror
Maximum error in microseconds (read-only).
.It Va esterror
Estimated error in microseconds (read-only).
.It Va tai
Temps Atomique International (French for International Atomic Time),
measures real time.
Used for acute time measurements.
.It Va time_state
Current time status.
.El
.Sh RETURN VALUES
.Rv -std ntp_gettime
.Pp
Possible states of the clock are:
.Pp
.Bl -tag -compact -width ".Dv TIME_ERROR"
.It Dv TIME_OK
Everything okay, no leap second warning.
.It Dv TIME_INS
Insert leap second warning.
.It Dv TIME_DEL
Delete leap second warning.
.It Dv TIME_OOP
Leap second in progress.
.It Dv TIME_WAIT
Leap second has occurred.
.It Dv TIME_ERROR
Clock not synchronized.
.El
.Sh SEE ALSO
.Xr ntp_adjtime 2 ,
.Xr ntpd 8
.Sh AUTHORS
This manual page was written by
.An Tom Rhodes Aq trhodes@FreeBSD.org .