OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / adjtimex.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995.
4 .\"
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, write to the Free
22 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" USA.
24 .\"
25 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
26 .\" Modified 1997-07-30 by Paul Slootman <paul@wurtel.demon.nl>
27 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
28 .\"
29 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
30 .\"         all rights reserved.
31 .\" Translated 1997-12-17, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
32 .\" Updated and Modified 2001-06-12,Yuichi SATO <ysato@h4.dion.ne.jp>
33 .\" Updated and Modified 2004-12-28, Yuichi SATO <ysato444@yahoo.co.jp>
34 .\" Updated 2006-07-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.34
35 .\"
36 .\"WORD:        kernel                  カーネル
37 .\"WORD:        algorithm               アルゴリズム
38 .\"WORD:        update                  更新
39 .\"WORD:        parameter               パラメーター
40 .\"WORD:        field                   フィールド
41 .\"WORD:        super user              スーパー・ユーザー
42 .\"WORD:        timer                   タイマー
43 .\"WORD:        interrupt               割り込み
44 .\"WORD:        memory                  メモリ
45 .\"
46 .TH ADJTIMEX 2 2004-05-27 "Linux" "Linux Programmer's Manual"
47 .\"O .SH NAME
48 .SH 名前
49 .\"O adjtimex \- tune kernel clock
50 adjtimex \- カーネルの時計を調整する
51 .\"O .SH SYNOPSIS
52 .SH 書式
53 .B #include <sys/timex.h>
54 .sp
55 .BI "int adjtimex(struct timex *" "buf" );
56 .\"O .SH DESCRIPTION
57 .SH 説明
58 .\"O Linux uses David L. Mills' clock adjustment algorithm (see RFC\ 1305).
59 .\"O The system call
60 .\"O .BR adjtimex ()
61 .\"O reads and optionally sets adjustment parameters for this algorithm.
62 Linux は David L. Mill の時計調節アルゴリズムを使用している
63 (RFC\ 1305 を参照)。
64 システムコール
65 .BR adjtimex ()
66 はこのアルゴリズムの調節のパラメーターを読み取ったり、設定したりする。
67 .\"O It takes a pointer to a
68 .\"O .I timex
69 .\"O structure, updates kernel parameters from field values,
70 .\"O and returns the same structure with current kernel values.
71 .\"O This structure is declared as follows:
72 この関数は
73 .I timex
74 構造体へのポインターを受け取り、その値でカーネルのパラメーターを更新して、
75 同じ構造体に現在のカーネルの値を返す。
76 この構造体は以下のように宣言される:
77 .PP
78 .in +4n
79 .nf
80 struct timex {
81     int modes;           /* mode selector */
82     long offset;         /* time offset (usec) */
83     long freq;           /* frequency offset (scaled ppm) */
84 .\" FIXME -- what is the scaling unit?  2^16 ?
85     long maxerror;       /* maximum error (usec) */
86     long esterror;       /* estimated error (usec) */
87     int status;          /* clock command/status */
88     long constant;       /* pll time constant */
89     long precision;      /* clock precision (usec) (read-only) */
90     long tolerance;      /* clock frequency tolerance (ppm)
91                             (read-only) */
92     struct timeval time; /* current time (read-only) */
93     long tick;           /* usecs between clock ticks */
94 };
95 .fi
96 .in
97 .PP
98 .\"O The
99 .\"O .I modes
100 .\"O field determines which parameters, if any, to set.
101 .\"O It may contain a
102 .\"O .RI bitwise- or
103 .\"O combination of zero or more of the following bits:
104 .I modes
105 フィールドは (必要に応じて) どのパラメーターを設定するか決定する。
106 それは以下のビット値の 0 個以上の
107 .RI "ビット " OR
108 からなる:
109 .PP
110 .in +4n
111 .nf
112 #define ADJ_OFFSET            0x0001 /* time offset */
113 #define ADJ_FREQUENCY         0x0002 /* frequency offset */
114 #define ADJ_MAXERROR          0x0004 /* maximum time error */
115 #define ADJ_ESTERROR          0x0008 /* estimated time error */
116 #define ADJ_STATUS            0x0010 /* clock status */
117 #define ADJ_TIMECONST         0x0020 /* pll time constant */
118 #define ADJ_TICK              0x4000 /* tick value */
119 #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime() */
120 .fi
121 .in
122 .PP
123 .\"O Ordinary users are restricted to a zero value for
124 .\"O .IR mode .
125 .\"O Only the superuser may set any parameters.
126 通常のユーザーは
127 .I mode
128 の値は 0 に制限されている。
129 スーパー・ユーザーのみが全てのパラメーターを設定できる。
130 .br
131 .ne 12v
132 .\"O .SH "RETURN VALUE"
133 .SH 返り値
134 .\"O On success,
135 .\"O .BR adjtimex ()
136 .\"O returns the clock state:
137 成功した場合、
138 .BR adjtimex ()
139
140 クロックの状態を返す:
141 .PP
142 .in +4n
143 .nf
144 #define TIME_OK  0 /* clock synchronized */
145 #define TIME_INS 1 /* insert leap second */
146 #define TIME_DEL 2 /* delete leap second */
147 #define TIME_OOP 3 /* leap second in progress */
148 #define TIME_BAD 4 /* clock not synchronized */
149 .fi
150 .in
151 .PP
152 .\"O On failure,
153 .\"O .BR adjtimex ()
154 .\"O returns \-1 and sets
155 .\"O .IR errno .
156 失敗した場合は
157 .BR adjtimex ()
158 は \-1 を返し、
159 .I errno
160 が設定される。
161 .\"O .SH ERRORS
162 .SH エラー
163 .TP
164 .B EFAULT
165 .\"O .I buf
166 .\"O does not point to writable memory.
167 .I buf
168 が書き込み可能なメモリを指していない。
169 .TP
170 .B EINVAL
171 .\"O An attempt is made to set
172 .\"O .I buf.offset
173 .\"O to a value outside the range \-131071 to +131071,
174 .\"O or to set
175 .\"O .I buf.status
176 .\"O to a value other than those listed above,
177 .\"O or to set
178 .\"O .I buf.tick
179 .\"O to a value outside the range
180 .\"O .RB 900000/ HZ
181 .\"O to
182 .\"O .RB 1100000/ HZ ,
183 .\"O where
184 .\"O .B HZ
185 .\"O is the system timer interrupt frequency.
186 .I buf.offset
187 へ \-131071 〜 +131071 の範囲以外の値を設定しようとしたか、
188 .I buf.status
189 に上記以外の値を設定しようとしたか、
190 .I buf.tick
191
192 .RB 900000/ HZ
193
194 .RB 1100000/ HZ
195 の範囲以外の値を設定しようとした。
196 ここで
197 .B HZ
198 はシステムのタイマー割り込みの周期である。
199 .TP
200 .B EPERM
201 .\"O .I buf.mode
202 .\"O is nonzero and the caller does not have sufficient privilege.
203 .I buf.mode
204 が 0 でなく、かつ呼び出し元が十分な特権を持っていない。
205 .\"O Under Linux the
206 .\"O .B CAP_SYS_TIME
207 .\"O capability is required.
208 Linux では
209 .B CAP_SYS_TIME
210 ケーパビリティが必要である。
211 .\"O .SH "CONFORMING TO"
212 .SH 準拠
213 .\"O .BR adjtimex ()
214 .\"O is Linux-specific and should not be used in programs
215 .\"O intended to be portable.
216 .\"O See
217 .\"O .BR adjtime (3)
218 .\"O for a more portable, but less flexible,
219 .\"O method of adjusting the system clock.
220 .BR adjtimex ()
221 は Linux 特有であり、
222 移植を意図したプログラムで使用すべきではない。
223 システムクロックを調整する方法で、
224 移植性があるが自由度は劣る方法については
225 .BR adjtime (3)
226 を参照のこと。
227 .\"O .SH "SEE ALSO"
228 .SH 関連項目
229 .BR settimeofday (2),
230 .BR adjtime (3),
231 .BR capabilities (7),
232 .BR time (7)