OSDN Git Service

2a963b19fb2e9ad9d097543cbf96eb78cb6e85b4
[linuxjm/LDP_man-pages.git] / draft / man2 / adjtimex.2
1 .\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995.
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
25 .\" Modified 1997-07-30 by Paul Slootman <paul@wurtel.demon.nl>
26 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
27 .\"
28 .\" FIXME 2.6.29 added ADJ_SETOFFSET
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .TH ADJTIMEX 2 2004\-05\-27 Linux "Linux Programmer's Manual"
36 .SH 名前
37 adjtimex \- カーネルの時計を調整する
38 .SH 書式
39 \fB#include <sys/timex.h>\fP
40 .sp
41 \fBint adjtimex(struct timex *\fP\fIbuf\fP\fB);\fP
42 .SH 説明
43 Linux は David L. Mill の時計調節アルゴリズムを使用している (RFC\ 1305 を参照)。 システムコール
44 \fBadjtimex\fP()  はこのアルゴリズムの調節のパラメーターを読み取ったり、設定したりする。 この関数は \fItimex\fP
45 構造体へのポインターを受け取り、その値でカーネルのパラメーターを更新して、 同じ構造体に現在のカーネルの値を返す。 この構造体は以下のように宣言される:
46 .PP
47 .in +4n
48 .nf
49 .\" FIXME -- what is the scaling unit?  2^16 ?
50 struct timex {
51     int modes;           /* mode selector */
52     long offset;         /* time offset (usec) */
53     long freq;           /* frequency offset (scaled ppm) */
54     long maxerror;       /* maximum error (usec) */
55     long esterror;       /* estimated error (usec) */
56     int status;          /* clock command/status */
57     long constant;       /* pll time constant */
58     long precision;      /* clock precision (usec) (read\-only) */
59     long tolerance;      /* clock frequency tolerance (ppm)
60                             (read\-only) */
61     struct timeval time; /* current time (read\-only) */
62     long tick;           /* usecs between clock ticks */
63 };
64 .fi
65 .in
66 .PP
67 \fImodes\fP フィールドは (必要に応じて) どのパラメーターを設定するか決定する。 それは以下のビット値の 0 個以上の ビット \fIOR\fP
68 からなる:
69 .PP
70 .in +4n
71 .nf
72 #define ADJ_OFFSET            0x0001 /* time offset */
73 #define ADJ_FREQUENCY         0x0002 /* frequency offset */
74 #define ADJ_MAXERROR          0x0004 /* maximum time error */
75 #define ADJ_ESTERROR          0x0008 /* estimated time error */
76 #define ADJ_STATUS            0x0010 /* clock status */
77 #define ADJ_TIMECONST         0x0020 /* pll time constant */
78 #define ADJ_TICK              0x4000 /* tick value */
79 #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old\-fashioned adjtime() */
80 .fi
81 .in
82 .PP
83 通常のユーザーは \fImode\fP の値は 0 に制限されている。 スーパー・ユーザーのみが全てのパラメーターを設定できる。
84 .br
85 .ne 12v
86 .SH 返り値
87 成功した場合、 \fBadjtimex\fP()  は クロックの状態を返す:
88 .PP
89 .in +4n
90 .nf
91 #define TIME_OK  0 /* clock synchronized */
92 #define TIME_INS 1 /* insert leap second */
93 #define TIME_DEL 2 /* delete leap second */
94 #define TIME_OOP 3 /* leap second in progress */
95 #define TIME_BAD 4 /* clock not synchronized */
96 .fi
97 .in
98 .PP
99 失敗した場合は \fBadjtimex\fP()  は \-1 を返し、 \fIerrno\fP が設定される。
100 .SH エラー
101 .TP 
102 \fBEFAULT\fP
103 \fIbuf\fP が書き込み可能なメモリを指していない。
104 .TP 
105 \fBEINVAL\fP
106 \fIbuf.offset\fP へ \-131071 〜 +131071 の範囲以外の値を設定しようとしたか、 \fIbuf.status\fP
107 に上記以外の値を設定しようとしたか、 \fIbuf.tick\fP に 900000/\fBHZ\fP 〜 1100000/\fBHZ\fP
108 の範囲以外の値を設定しようとした。 ここで \fBHZ\fP はシステムのタイマー割り込みの周期である。
109 .TP 
110 \fBEPERM\fP
111 \fIbuf.mode\fP が 0 でなく、かつ呼び出し元が十分な特権を持っていない。 Linux では \fBCAP_SYS_TIME\fP
112 ケーパビリティが必要である。
113 .SH 準拠
114 \fBadjtimex\fP()  は Linux 特有であり、 移植を意図したプログラムで使用すべきではない。 システムクロックを調整する方法で、
115 移植性があるが自由度は劣る方法については \fBadjtime\fP(3)  を参照のこと。
116 .SH 関連項目
117 \fBsettimeofday\fP(2), \fBadjtime\fP(3), \fBcapabilities\fP(7), \fBtime\fP(7)
118 .SH この文書について
119 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
120 である。プロジェクトの説明とバグ報告に関する情報は
121 http://www.kernel.org/doc/man\-pages/ に書かれている。