From owner-man-jp-reviewer@jp.FreeBSD.org Mon May 19 09:33:39 2003
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id h4J0XdW58111;
	Mon, 19 May 2003 09:33:39 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from mx02.mitsumi.co.jp (mx02.mitsumi.co.jp [202.33.112.205])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id h4J0XdY58106
	for <man-jp-reviewer@jp.FreeBSD.org>; Mon, 19 May 2003 09:33:39 +0900 (JST)
	(envelope-from a_ikeuchi@mic.mitsumi.co.jp)
Received: from mvc01.mitsumi.co.jp ([192.168.1.254])
	by mx02.mitsumi.co.jp (8.11.6p2/8.11.6) with ESMTP id h4J0aak30478
	for <man-jp-reviewer@jp.FreeBSD.org>; Mon, 19 May 2003 09:36:36 +0900
Received: from mmx01.mitsumi.co.jp (localhost [127.0.0.1] (may be forged))
	by mvc01.mitsumi.co.jp (8.11.6/8.11.6) with ESMTP id h4J0SL413491
	for <man-jp-reviewer@jp.FreeBSD.org>; Mon, 19 May 2003 09:28:21 +0900
Received: from ml01.mic.mitsumi.co.jp (mic.mitsumi.co.jp [172.17.5.244] (may be forged))
	by mmx01.mitsumi.co.jp (8.9.3p2+3.2W/3.7W) with ESMTP id JAA12392
	for <man-jp-reviewer@jp.FreeBSD.org>; Mon, 19 May 2003 09:33:30 +0900
Received: from mic.mitsumi.co.jp (a-ikeuchi.mic.mitsumi.co.jp [172.17.40.89])
	by ml01.mic.mitsumi.co.jp (8.10.2/8.10.2) with ESMTP id h4J0I8818395;
	Mon, 19 May 2003 09:18:13 +0900
Message-ID: <3EC823A2.50100@mic.mitsumi.co.jp>
From: Akira Ikeuchi <a_ikeuchi@mic.mitsumi.co.jp>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.3) Gecko/20030328
X-Accept-Language: ja, en-us, en
MIME-Version: 1.0
To: man-jp-reviewer@jp.FreeBSD.org
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Reply-To: man-jp-reviewer@jp.FreeBSD.org
Precedence: list
Date: Mon, 19 May 2003 09:21:54 +0900
X-Sequence: man-jp-reviewer 4398
Subject: [man-jp-reviewer 4398] (man2) ntp_adjtime.2
Sender: owner-man-jp-reviewer@jp.FreeBSD.org
X-Originator: a_ikeuchi@mic.mitsumi.co.jp
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+030514

$BCSFb$G$9!#(B

ntp_adjtime.2 $B$N=iLu$G$9!#(B
$B%A%'%C%/$*4j$$CW$7$^$9!#(B

"leap second" $B$r(B "$B$&$k$&IC(B" $B$H(B
$BLu$7$F$$$k$N$G$9$,!":#0l$J46$8$G$9!#(B
$BE,Lu$,8+$D$+$j$^$;$s$G$7$?!#(B


.\"
.\" 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: src/lib/libc/sys/ntp_adjtime.2,v 1.1 2003/04/15 15:42:10 trhodes Exp $
.\"
.Dd April 1, 2003
.Dt NTP_ADJTIME 2
.Os
.Sh $BL>>N(B
.Nm ntp_adjtime
.Nd NTP $B%G!<%b%s%"%W%j%1!<%7%g%s%$%s%?%U%'!<%9(B
.Sh $B=q<0(B
.In sys/types.h
.In sys/timex.h
.Ft int
.Fn ntp_adjtime "struct timex *tp"
.Sh $B2r@b(B
.Fn ntp_adjtime
$B%7%9%F%`%3!<%k$O(B Network Time Protocol ($B%M%C%H%o!<%/%?%$%`%W%m%H%3%k(B) $B%G!<%b%s(B
.Xr ntpd 8
$B$N$?$a$N%+!<%M%k%$%s%?%U%'!<%9$H$7$F;HMQ$5$l$^$9!#(B
.Vt timex
$B9=B$BN$N?.Mj$G$-$k%U%#!<%k%I$O!"(B
.Va status
$B%o!<%I$N(B
.Dv STA_NANO
$B%S%C%H$N>uBV$K=>$C$F!"%^%$%/%mIC$^$?$O%J%NIC$KJQ49$5$l$^$9!#(B
.Pp
.Fx
$B%+!<%M%k$NCf$G$O!"(B
.Fn ntp_adjtime
$B$*$h$S(B
.Xr ntp_gettime 2
$B%7%9%F%`%3!<%k$O$I$A$i$NJ,2rG=$r;HMQ$9$k$+$r7hDj$9$k$?$a$K!"$^$?$O(B
$B$b$&0lJ}$rA*Br$9$k$?$a$K!"$$$D$G$b;HMQ$9$k$3$H$,2DG=$G$9!#(B
$BA*Br$5$l$?J,2rG=$O!"(B
.Fn ntp_gettime
$B$*$h$S(B
.Fn ntp_adjtime
$B%7%9%F%`%3!<%k$NCf$N?.Mj$G$-$k%U%#!<%k%I$N%9%1!<%j%s%0$K1F6A$r5Z$\$7$^$9!#(B
.Pp
$B$3$N(B
.Tn API
$B$OHs>o$KJ#;($GB?$/$N>uBV$,$"$k$3$H$K!"Cm0U$7$F$/$@$5$$!#(B
$B%f!<%6$O!"$O$8$a$K(B
.Xr ntpd 8
$B$N%=!<%9$rE0DlE*$K6cL#$9$k$3$H$J$7$K!"=$@5$r;n$_$k$Y$-$G$O$"$j$^$;$s!#(B
.Bd -literal
/*
 * NTP $B%G!<%b%s%$%s%?%U%'!<%9(B (ntp_adjtime()) - CPU $B%/%m%C%/H/?64o$N(B
 * $BM^@)$H>uBV$N7hDj$N$?$a$K;HMQ$5$l$^$9!#(B
 *
 * $BCm0U(B: offset, precision $B$*$h$S(B jitter $B%a%s%P$O(B STA_NANO $B$,(B 0 $B$G$"$l$P(B
 * $B%^%$%/%mIC$G!"$=$&$G$J$1$l$P%J%NIC$G$9!#(B
 */
struct timex {
	unsigned int modes;	/* $B%/%m%C%/%b!<%I%S%C%H(B (wo) */
	long	offset;		/* $B;~9o%*%U%;%C%H(B (ns/us) (rw) */
	long	freq;		/* $B<~GH?t%*%U%;%C%H(B (PPM $BC10L(B) (rw) */
	long	maxerror;	/* $B:GBg8m:9(B (us) (rw) */
	long	esterror;	/* $B?dDj8m:9(B (us) (rw) */
	int	status;		/* $B%/%m%C%/>uBV%S%C%H(B (rw) */
	long	constant;	/* $B%]!<%k4V3V(B (log2 s) (rw) */
	long	precision;	/* $B;~9o$N@:EY(B (ns/us) (ro) */
	long	tolerance;	/* $B%/%m%C%/<~GH?t$N8x:9(B (PPM $BC10L(B) (ro) */
	/*
	 * $B0J2<$NFI$_<h$j@lMQ$N9=B$BN%a%s%P$O!"%+!<%M%kFb$K(B PPS
	 * $B%7%0%J%kM^@)$,7A@.$5$l$F$$$k>l9g$N$_<BAu$5$l$^$9!#(B
	 * $B$3$l$i$O%]!<%?%S%j%F%#$rJ]>c$9$k$?$a$K!"A4$F$N7A@.>uBV(B
	 * $B$K$*$$$F4^$^$l$^$9!#(B
	 */
	long	ppsfreq;	/* PPS $B<~GH?t(B (PPM $BC10L(B) (ro) */
	long	jitter;		/* PPS $B%8%C%?(B (ns/us) (ro) */
	int	shift;		/* $BB8B34|4V(B (s) ($B%7%U%H(B) (ro) */
	long	stabil;		/* PPS $B0BDj@-(B (PPM $BC10L(B) (ro) */
	long	jitcnt;		/* $BD62a$7$?%8%C%?@)8B(B (ro) */
	long	calcnt;		/* $BB,Dj4V3V(B (ro) */
	long	errcnt;		/* $BB,Dj8m:9(B (ro) */
	long	stbcnt;		/* $BD62a$7$?0BDj@-@)8B(B (ro) */
};
.Ed
.Pp
$B@.8y$7$F40N;$7$?$H$-$K$O!"(B
.Fn ntp_adjtime
$B$O(B
.Fa tp
$B0z?t$K8=:_$N%/%m%C%/$N>uBV$rF~$l$^$9!#(B
.Sh $BLa$jCM(B
.Rv -std ntp_adjtime
.Pp
$B5/$3$j$&$k%/%m%C%/$N>uBV$O0J2<$N$H$*$j$G$9(B:
.Pp
.Bl -tag -compact -width ".Dv TIME_ERROR"
.It Dv TIME_OK
$BA4$F$,(B OK $B$G!"$&$k$&IC$N7Y9p$b$"$j$^$;$s!#(B
.It Dv TIME_INS
$B$&$k$&ICA^F~$N7Y9p$G$9!#(B
.It Dv TIME_DEL
$B$&$k$&IC:o=|$N7Y9p$G$9!#(B
.It Dv TIME_OOP
$B$&$k$&IC$N7P2aCf$G$9!#(B
.It Dv TIME_WAIT
$B$&$k$&IC$,H/@8$7$^$7$?!#(B
.It Dv TIME_ERROR
$B%/%m%C%/$,F14|$7$F$$$^$;$s!#(B
.El
.Sh $B%(%i!<(B
.Fn ntp_gettime
$B%7%9%F%`%3!<%k$O!"8F$S=P$7B&$,==J,$J%Q!<%_%7%g%s$r;}$C$F$$$J$$>l9g$K!"(B
.Er EPERM
$B$rJV$9$3$H$,$"$j$^$9!#(B
.Sh $B4XO"9`L\(B
.Xr ntp_gettime 2 ,
.Xr ntpd 8
.Sh $B:n<T(B
$B$3$N%^%K%e%"%k%Z!<%8$O(B
.An Tom Rhodes Aq trhodes@FreeBSD.org
$B$,=q$-$^$7$?!#(B

