File: rtc.4

package info (click to toggle)
manpages-ja 0.5.0.0.20061115-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,788 kB
  • ctags: 4
  • sloc: sh: 13,215; perl: 157; makefile: 117
file content (231 lines) | stat: -rw-r--r-- 6,689 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
.\" rtc.4
.\" Copyright 2002 Urs Thuermann (urs@isnogud.escape.de)
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.\" $Id: rtc.4,v 1.4 2005/12/05 17:19:49 urs Exp $
.\"
.\" 2006-02-08 Various additions by mtk
.\"
.\" Japanese Version Copyright (c) 2006 Yuichi SATO
.\"         all rights reserved.
.\" Translated 2006-07-12
.\"         by Yuichi SATO <ysato444@yahoo.co.jp>. Catch up to LDP v2.29
.\"
.TH RTC 4 "2005-12-05" "Linux" "Linux Programmer's Manual"
.SH ̾
rtc \- ꥢ륿९å
.SH 
#include <linux/rtc.h>
.SH 
ϥꥢ륿९å (RTC) Υɥ饤ФǤ롣

¿Υԥ塼ϡ̤˥ꥢ륿९åȸƤФ롢
Ȥ߹ߤΥϡɥåäƤ롣
λפ̾ӤǶưΤǡ
ԥ塼ΥåڤäƤ⡢ݻǤ롣
λפϸ߻ǯʬäɽ

RTC ϻ֤դåפǡ
ꤷ˳ߤȯ뤳ȤǤ롣
ΥåפϡΤϰ̤ Motorola MC146818, Dallas DS12887 
θߴʤǤäǤϥޥܡɤ
åץåǼƤ뤳Ȥ¿

RTC 򥷥ƥȺƱ٤ǤϤʤ
ƥϡΩߤ˶ư륽եȥåǡ
ͥ˴Ƥ롣
եȥåϡŪˤ 100, 250, 1000 Hz Ȥȿ
ߥ롼Ǵ롣
եȥåϡPOSIX ˤ뵪 (Epoch)
Ĥޤ Jan 1, 1970, 0:00 UTC äȥߥä򥫥ȤƤ롣
Υå̤ʥϡɥȤäƤʤ

RTC 
.BR hwclock (8)
ɤ߹ߤ꤬Ǥ롣

RTC  Linux ͥǤϤۤȤɻȤƤʤ
ˡͥϥեȥå
.BR time (2),
.BR gettimeofday (2),
եΥॹפʤɤ˻ȤäƤ롣
ͥϥ֡Ȼ RTC ɤ߹ǡ
եȥå롣

դȻ֤򥫥ȤΤ˲äơ
RTC ϰʲΤ褦˳ߤȯǤ롣
.IP *
åι (Ĥޤ 1 )
.IP *
2 Hz  8192 Hz ޤǤ 2 ξμȿǡŪʴֳ֡
.IP *
äƻꤷ顼ã
.PP
γ߸ϡ̤ͭˤ̵ˤǤ롣

.B /dev/rtc
ǥХƱ 1 󤷤ץ󤹤뤳ȤǤ
ɤ߹ѤǤ롣
.BR read (2)

.BR select (2)
ƤӽФץϡ
RTC γߤޤ (block) 롣
ߤθ塢ץ long ɤ߽ФȤǤ롣
κDz̥ХȤȯߤμ̤Ǥꡢ
Ĥ 3 ХȤϺǸ
.BR read (2)
ʹߤȯߤβǤ롣

ʲ
.BR ioctl (2)
󶡤Ƥ:
.TP
.B RTC_RD_TIME
RTC λʲι¤Τ֤:
.PP
.RS
.in +0.5i
.nf
struct rtc_time {
    int tm_sec;
    int tm_min;
    int tm_hour;
    int tm_mday;
    int tm_mon;
    int tm_year;
    int tm_wday;     /* ̤ */
    int tm_yday;     /* ̤ */
    int tm_isdst;    /* ̤ */
};
.fi
.in -0.5i
.RE
.IP
ι¤ΤΥեɤ
.BR gmtime (3)
Ƥ
.I tm
¤ΤΥեɤƱ̣ƱϰϤǤ롣
ι¤ΤؤΥݥ󥿤
.BR ioctl ()
 3 ȤϤ
.TP
.B RTC_SET_TIME
.BR ioctl ()
 3 ؤ
.I rtc_time
¤Τͤ RTC ꤹ롣
RTC ꤹ硢ץø
(Ĥޤ
.B CAP_SYS_TIME
ѥӥƥ) ʤФʤʤ
.TP
.BR RTC_ALM_READ ", " RTC_ALM_SET
顼ɤ߹ߤԤ
\fBioctl\fP()  3 ϡ
.I rtc_time 
¤ΤؤΥݥ󥿤ǤʤФʤʤ
ι¤Τ
.IR tm_sec ,
.IR tm_min ,
.IR tm_hour
եɤΤߤѤ롣
.TP
.BR RTC_IRQP_READ ", " RTC_IRQP_SET
Ūʳߤμȿɤ߹ߤԤ
\fBioctl\fP()  3 ϡ줾
.I "long\ *"

.I long
Ǥ롣
ͤ 1 γߤβǤ롣
ǽʼȿϡ2 ξ 2  8192 ϰϤǤ롣
øץ (Ĥޤ
.B CAP_SYS_RESOURCE
ѥӥƥĥץ) Τߤ
.I /proc/sys/dev/rtc/max-user-freq
˽񤫤줿嵭μȿǤ롣
(ΥեˤϥǥեȤ 64 Ȥͤ񤫤Ƥ)
.TP
.BR RTC_AIE_ON ", " RTC_AIE_OFF
顼ߤͭޤ̵ˤ롣
\fBioctl\fP()  3 ̵뤵롣
.TP
.BR RTC_UIE_ON ", " RTC_UIE_OFF
åγߤͭޤ̵ˤ롣
\fBioctl\fP()  3 ̵뤵롣
.TP
.BR RTC_PIE_ON ", " RTC_PIE_OFF
Ūʳߤͭޤ̵ˤ롣
\fBioctl\fP()  3 ̵뤵롣
øץ (Ĥޤ
.B CAP_SYS_RESOURCE
ѥӥƥĥץ) Τߤ
λ
.I /proc/sys/dev/rtc/max-user-freq
˼嵭ͤ˻ꤵƤˡ
ŪʳߤͭˤǤ롣
.TP
.BR RTC_EPOCH_READ ", " RTC_EPOCH_SET
RTC ǯ 8 ӥåȤΥ쥸˥ɲ롣
ǯ 8 ӥåȤΥХʥޤ BCD Ѵ롣
ɤξǤ⡢οͤ RTC εͤѴ롣
¿ΥƥǤ RTC ε 1900 ˽뤬
Alpha  Mips ǤϡRTC 쥸ǯͤ˱ơ
1952, 1980, 2000 β줫˽롣

Ϥ줾 RTC εɤ߹ߤ˻Ѥ롣
RTC εꤹ硢ץø (Ĥޤ
.B CAP_SYS_TIME
ѥӥƥ) ʤФʤʤ
.SH ե
.IR /dev/rtc : 
RTC ü쥭饯ǥХե

.IR /proc/driver/rtc : 
RTC ξ
.SH 
ͥΥƥ
.BR adjtimex (2)
ȤäƳȤƱ硢
.BR adjtimex (2)
 RTC  11 ʬŪ˹롣
ԤᥫͥϼŪʳߤû̵ˤɬפ롣
 RTC Ȥץ˱ƶͿ롣

RTC εϡƥ९åǤΤ߻Ѥ
POSIX εȤϲδطʤ

RTC ε˴Ťǯ RTC ǯΥ쥸 1970 ̤Ǥ硢
100 ǯ塢Ĥޤ 2000  2069 ǤȲꤵ롣
.SH Ϣ
.BR hwclock (8),
.BR date (1),
.BR time (2),
.BR stime (2),
.BR gettimeofday (2),
.BR settimeofday (2),
.BR adjtimex (2),
.BR gmtime (3),
.BR time (7),
/usr/src/linux/Documentation/rtc.txt