X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=draft%2Fman4%2Frtc.4;h=38537a6c5e30f9232c886891d4694c4f37e8ea60;hb=d64f6f809e331352f863bdb422001aaaaea4cbdd;hp=27003f6b0fe7867cf624373c961bc4370131885d;hpb=633a2252e0be3c867dce264a180a89ce8181d36f;p=linuxjm%2FLDP_man-pages.git diff --git a/draft/man4/rtc.4 b/draft/man4/rtc.4 index 27003f6b..38537a6c 100644 --- a/draft/man4/rtc.4 +++ b/draft/man4/rtc.4 @@ -26,192 +26,68 @@ .\" 2006-02-08 Various additions by mtk .\" 2006-11-26 cleanup, cover the generic rtc framework; David Brownell .\" -.\" Japanese Version Copyright (c) 2006-2007 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-07-12 by Yuichi SATO . LDP v2.29 -.\" Updated & Modified 2007-01-08 by Yuichi SATO. LDP v2.43 +.\"******************************************************************* .\" -.TH RTC 4 2010-02-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH ̾Á° -.\"O rtc \- real-time clock -rtc \- ¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯ -.\"O .SH SYNOPSIS -.SH ½ñ¼° +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH RTC 4 2010\-02\-25 Linux "Linux Programmer's Manual" +.SH 名前 +rtc \- リアルタイムクロック +.SH 書式 #include .sp -.BI "int ioctl(" fd ", RTC_" request ", " param ");" -.\"O .SH DESCRIPTION -.SH ÀâÌÀ -.\"O This is the interface to drivers for real-time clocks (RTCs). -¤³¤ì¤Ï¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯ (RTC) ¤Î¥É¥é¥¤¥Ð¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£ - -.\"O Most computers have one or more hardware clocks which record the -.\"O current "wall clock" time. -.\"O These are called "Real Time Clocks" (RTCs). -.\"O One of these usually has battery backup power so that it tracks the time -.\"O even while the computer is turned off. -.\"O RTCs often provide alarms and other interrupts. -¿¤¯¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ï¡¢¸½ºß¤Î¡ÖÊÉ»þ·×¡×»þ¹ï ("wall clock" time) ¤òµ­Ï¿¤¹¤ë¡¢ -¥Ï¡¼¥É¥¦¥§¥¢¥¯¥í¥Ã¥¯¤ò 1 ¸Ä°Ê¾å»ý¤Ã¤Æ¤¤¤ë¡£ -¤³¤ì¤é¤Ï¡Ö¥ê¥¢¥ë¥¿¥¤¥à¥¯¥í¥Ã¥¯¡×(RTC) ¤È¸Æ¤Ð¤ì¤ë¡£ -¤³¤ì¤é¤Î»þ·×¤Î¤¦¤Á 1 ¤Ä¤Ï¡¢Ä̾ï¤ÏÅÅÃӤǥХ寥¢¥Ã¥×¤·¤Æ¶îÆ°¤µ¤ì¤ë¤Î¤Ç¡¢ -¥³¥ó¥Ô¥å¡¼¥¿¤Î¥¹¥¤¥Ã¥Á¤òÀڤäƤ⡢»þ¹ï¤òÊÝ»ý¤Ç¤­¤ë¡£ -¿¤¯¤Î¾ì¹ç¡¢RTC ¤Ï¥¢¥é¡¼¥à¤ä¤½¤Î¾¤Î³ä¤ê¹þ¤ß¤Îµ¡Ç½¤òÄ󶡤¹¤ë¡£ +\fBint ioctl(\fP\fIfd\fP\fB, RTC_\fP\fIrequest\fP\fB, \fP\fIparam\fP\fB);\fP +.SH 説明 +これはリアルタイムクロック (RTC) のドライバのインタフェースである。 -.\"O All i386 PCs, and ACPI based systems, have an RTC that is compatible with -.\"O the Motorola MC146818 chip on the original PC/AT. -.\"O Today such an RTC is usually integrated into the mainboard's chipset -.\"O (south bridge), and uses a replaceable coin-sized backup battery. -Á´¤Æ¤Î i386 PC ¤È ACPI ¥Ù¡¼¥¹¤Î¥·¥¹¥Æ¥à¤Ë¤Ï RTC ¤¬¤¢¤ë¡£ -¤³¤Î RTC ¤Ï¡¢¸µ¡¹¤Î PC/AT ¤Ë¸ºß¤·¤¿ -Motorola MC146818 ¥Á¥Ã¥×¤È¸ß´¹À­¤¬¤¢¤ë¡£ -¤³¤Î¤è¤¦¤Ê RTC ¤Ï¡¢º£Æü¤Ç¤Ï¥Þ¥¶¡¼¥Ü¡¼¥É¤Î -¥Á¥Ã¥×¥»¥Ã¥È (¥µ¥¦¥¹¥Ö¥ê¥Ã¥¸) Æâ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¯¡¢ -¸ò´¹²Äǽ¤Ê¹Å²ß¤¯¤é¤¤¤ÎÂ礭¤µ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×ÅÅÃÓ¤ò»È¤Ã¤Æ¤¤¤ë¡£ +多くのコンピュータは、現在の「壁時計」時刻 ("wall clock" time) を記録する、 ハードウェアクロックを 1 個以上持っている。 +これらは「リアルタイムクロック」(RTC) と呼ばれる。 これらの時計のうち 1 つは、通常は電池でバックアップして駆動されるので、 +コンピュータのスイッチを切っても、時刻を保持できる。 多くの場合、RTC はアラームやその他の割り込みの機能を提供する。 -.\"O Non-PC systems, such as embedded systems built around system-on-chip -.\"O processors, use other implementations. -.\"O They usually won't offer the same functionality as the RTC from a PC/AT. -¥·¥¹¥Æ¥à¥ª¥ó¥Á¥Ã¥× (system-on-chip) ¥×¥í¥»¥Ã¥µ¤ò»È¤Ã¤Æºî¤é¤ì¤¿ -ÁȤ߹þ¤ß¥·¥¹¥Æ¥à¤È¤¤¤Ã¤¿¡¢PC °Ê³°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Ê̤ʼÂÁõ¤òÍѤ¤¤Æ¤¤¤ë¡£ -¤³¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤Ç¤Ï¡¢PC/AT ¤Î RTC ¤ÈƱ¤¸µ¡Ç½¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤¬Â¿¤¤¡£ +全ての i386 PC と ACPI ベースのシステムには RTC がある。 この RTC は、元々の PC/AT に存在した Motorola +MC146818 チップと互換性がある。 このような RTC は、今日ではマザーボードの チップセット (サウスブリッジ) +内で実装されていることが多く、 交換可能な硬貨くらいの大きさのバックアップ電池を使っている。 -.\"O .SS RTC vs System Clock -.SS RTC ¤È¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Î°ã¤¤ -.\"O RTCs should not be confused with the system clock, which is -.\"O a software clock maintained by the kernel and used to implement -.\"O .BR gettimeofday (2) -.\"O and -.\"O .BR time (2), -.\"O as well as setting timestamps on files, etc. -RTC ¤ò¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Èº®Æ±¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ -¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï¡¢¥«¡¼¥Í¥ë¤Ë´ÉÍý¤µ¤ì¤ë¥½¥Õ¥È¥¦¥§¥¢¥¯¥í¥Ã¥¯¤Ç¤¢¤ê¡¢ -¥Õ¥¡¥¤¥ë¤Ë¤è¤ë¥¿¥¤¥à¥¹¥¿¥ó¥×ÀßÄê¤Ê¤É¤È¤È¤â¤Ë¡¢ -.BR gettimeofday (2) -¤ä -.BR time (2) -¤ò¼ÂÁõ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£ -.\"O The system clock reports seconds and microseconds since a start point, -.\"O defined to be the POSIX Epoch: 1970-01-01 00:00:00 +0000 (UTC). -¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï¡¢POSIX ¤Ë¤ª¤±¤ëµª¸µ -(Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÉäȥߥêÉäòɽ¤¹¡£ -.\"O (One common implementation counts timer interrupts, once -.\"O per "jiffy", at a frequency of 100, 250, or 1000 Hz.) -.\"O That is, it is supposed to report wall clock time, which RTCs also do. -1 ¤Ä¤Î°ìÈÌŪ¤Ê¼ÂÁõ¤Ç¤Ï¥¿¥¤¥Þ¡¼³ä¤ê¹þ¤ß¤ò¡¢"jiffy" Ëè¤Ë 1 ²ó¡¢ -100, 250, 1000 Hz ¤È¤¤¤¦¼þÇÈ¿ô¤Ç¥«¥¦¥ó¥È¤¹¤ë¡£ +システムオンチップ (system\-on\-chip) プロセッサを使って作られた 組み込みシステムといった、PC +以外のシステムでは、別な実装を用いている。 このようなシステムでは、PC/AT の RTC と同じ機能を提供していない場合が多い。 +.SS "RTC とシステムクロックの違い" +RTC をシステムクロックと混同すべきではない。 システムクロックは、カーネルに管理されるソフトウェアクロックであり、 +ファイルによるタイムスタンプ設定などとともに、 \fBgettimeofday\fP(2) や \fBtime\fP(2) を実装するのに使用されている。 +システムクロックは、POSIX における紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの秒とミリ秒を表す。 +1 つの一般的な実装ではタイマー割り込みを、"jiffy" 毎に 1 回、 100, 250, 1000 Hz という周波数でカウントする。 -.\"O A key difference between an RTC and the system clock is that RTCs -.\"O run even when the system is in a low power state (including "off"), -.\"O and the system clock can't. -RTC ¤È¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Î½ÅÍפʰ㤤¤Ï¡¢ -RTC ¤Ï¥·¥¹¥Æ¥à¤¬ÄãÅÅÎϾõÂÖ (¡Ö¥ª¥Õ¡×¤Î¾ì¹ç¤â´Þ¤à) ¤Ç¤âÆ°ºî¤¹¤ë¤Î¤ËÂФ·¡¢ -¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ÏÆ°ºî¤·¤Ê¤¤ÅÀ¤Ç¤¢¤ë¡£ -.\"O Until it is initialized, the system clock can only report time since -.\"O system boot ... not since the POSIX Epoch. -¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï¡¢½é´ü²½¤¬¹Ô¤ï¤ì¤ë¤Þ¤Ç¤Ï¡¢ -POSIX µª¸µ¤«¤é¤Ç¤Ï¤Ê¤¯¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È»þ¤«¤é¤Î»þ¹ï¤·¤«ÊÖ¤»¤Ê¤¤¡£ -.\"O So at boot time, and after resuming from a system low power state, the -.\"O system clock will often be set to the current wall clock time using an RTC. -¤½¤Î¤¿¤á¡¢¥Ö¡¼¥È»þ¤ä¥·¥¹¥Æ¥à¤ÎÄãÅÅÎϾõÂÖ¤«¤é¤ÎÉüµ¢ (resume) ¸å¤Ë¤Ï¡¢ -¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ï RTC ¤ò»È¤Ã¤Æ¸½ºß¤ÎÊÉ»þ·×»þ¹ï¤ËÀßÄꤵ¤ì¤ë¾ì¹ç¤¬Â¿¤¤¡£ -.\"O Systems without an RTC need to set the system clock using another clock, -.\"O maybe across the network or by entering that data manually. -RTC ¤ò»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ -¾¤Î»þ·×¤ò»È¤Ã¤Æ¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¡¢ -¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¥¢¥¯¥»¥¹¤·¤¿¤ê¡¢(»þ¹ï) ¥Ç¡¼¥¿¤ò¼êÆ°¤ÇÆþÎϤ·¤¿¤ê¤¹¤ë¤À¤í¤¦¡£ -.\"O .SS RTC functionality -.SS RTC ¤Îµ¡Ç½ -.\"O RTCs can be read and written with -.\"O .BR hwclock (8), -.\"O or directly with the ioctl requests listed below. -RTC ¤Ï -.BR hwclock (8) -¤Þ¤¿¤Ï²¼µ­¤Î ioctl ¥ê¥¯¥¨¥¹¥È¤ÇÆɤ߽ñ¤­¤¬¤Ç¤­¤ë¡£ +RTC とシステムクロックの重要な違いは、 RTC はシステムが低電力状態 (「オフ」の場合も含む) でも動作するのに対し、 +システムクロックは動作しない点である。 システムクロックは、初期化が行われるまでは、 POSIX +紀元からではなくシステムのブート時からの時刻しか返せない。 そのため、ブート時やシステムの低電力状態からの復帰 (resume) 後には、 +システムクロックは RTC を使って現在の壁時計時刻に設定される場合が多い。 RTC を持たないシステムでは、 +他の時計を使ってシステムクロックを設定する必要があり、 ネットワークにアクセスしたり、(時刻) データを手動で入力したりするだろう。 +.SS "RTC の機能" +RTC は \fBhwclock\fP(8) または下記の ioctl リクエストで読み書きができる。 -.\"O Besides tracking the date and time, many RTCs can also generate -.\"O interrupts -ÆüÉդȻþ´Ö¤ò¥«¥¦¥ó¥È¤¹¤ë¤Î¤Ë²Ã¤¨¤Æ¡¢ -¿¤¯¤Î RTC ¤Ï°Ê²¼¤Î¤è¤¦¤Ë³ä¤ê¹þ¤ß¤òȯÀ¸¤Ç¤­¤ë¡£ +日付と時間をカウントするのに加えて、 多くの RTC は以下のように割り込みを発生できる。 .IP * 3 -.\"O on every clock update (i.e., once per second); -¥¯¥í¥Ã¥¯¤Î¹¹¿·Ëè (¤Ä¤Þ¤ê 1 ÉÃËè)¡£ +クロックの更新毎 (つまり 1 秒毎)。 .IP * -.\"O at periodic intervals with a frequency that can be set to -.\"O any power-of-2 multiple in the range 2 Hz to 8192 Hz; -2 Hz ¤«¤é 8192 Hz ¤Þ¤Ç¤Î 2 ¤Î¾è¿ô¤Î¼þÇÈ¿ô¤Ç¡¢Äê´üŪ¤Ê´Ö³Ö¡£ +2 Hz から 8192 Hz までの 2 の乗数の周波数で、定期的な間隔。 .IP * -.\"O on reaching a previously specified alarm time. -Á°¤â¤Ã¤Æ»ØÄꤷ¤¿¥¢¥é¡¼¥à»þ¹ï¤Ë㤷¤¿»þ¡£ +前もって指定したアラーム時刻に達した時。 .PP -.\"O Each of those interrupt sources can be enabled or disabled separately. -¤³¤ì¤é¤Î³ä¤ê¹þ¤ß¸µ¤Ï¡¢¸ÄÊ̤ËÍ­¸ú¤Ë¤·¤¿¤ê̵¸ú¤Ë¤·¤¿¤ê¤Ç¤­¤ë¡£ -.\"O On many systems, the alarm interrupt can be configured as a system wakeup -.\"O event, which can resume the system from a low power state such as -.\"O Suspend-to-RAM (STR, called S3 in ACPI systems), -.\"O Hibernation (called S4 in ACPI systems), -.\"O or even "off" (called S5 in ACPI systems). -¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤ò¥·¥¹¥Æ¥à¤Î -¥¦¥§¥¤¥¯¥¢¥Ã¥×¥¤¥Ù¥ó¥È¤È¤·¤ÆÀßÄê¤Ç¤­¤ë¡£ -¤³¤Î¥¤¥Ù¥ó¥È¤Ï¡¢RAM ¤Ø¤Î¥µ¥¹¥Ú¥ó¥É (STR, ACPI ¥·¥¹¥Æ¥à¤Ç S3 ¤È¸Æ¤Ð¤ì¤ë) ¤ä -¥Ï¥¤¥Ð¡¼¥Í¡¼¥·¥ç¥ó (ACPI ¥·¥¹¥Æ¥à¤Ç S4 ¤È¸Æ¤Ð¤ì¤ë) ¤È¤¤¤Ã¤¿ÄãÅÅÎϾõÂ֤䡢 -¡Ö¥ª¥Õ¡×(ACPI ¥·¥¹¥Æ¥à¤Ç S5 ¤È¸Æ¤Ð¤ì¤ë) ¤«¤é¤Ç¤â¡¢¥·¥¹¥Æ¥à¤òÉüµ¢¤Ç¤­¤ë¡£ -.\"O On some systems, the battery backed RTC can't issue -.\"O interrupts, but another one can. -ÅÅÃӤǥХ寥¢¥Ã¥×¤µ¤ì¤¿ RTC ¤¬³ä¤ê¹þ¤ß¤òȯÀ¸¤Ç¤­¤ë¥·¥¹¥Æ¥à¤È¡¢ -¤Ç¤­¤Ê¤¤¥·¥¹¥Æ¥à¤¬¤¢¤ë¡£ +これらの割り込み元は、個別に有効にしたり無効にしたりできる。 多くのシステムでは、アラーム割り込みをシステムの ウェイクアップイベントとして設定できる。 +このイベントは、RAM へのサスペンド (STR, ACPI システムで S3 と呼ばれる) や ハイバーネーション (ACPI システムで S4 +と呼ばれる) といった低電力状態や、 「オフ」(ACPI システムで S5 と呼ばれる) からでも、システムを復帰できる。 電池でバックアップされた +RTC が割り込みを発生できるシステムと、 できないシステムがある。 -.\"O The -.\"O .I /dev/rtc -.\"O (or -.\"O .IR /dev/rtc0 , -.\"O .IR /dev/rtc1 , -.\"O etc.) -.\"O device can be opened only once (until it is closed) and it is read-only. -.I /dev/rtc -(¤Þ¤¿¤Ï -.IR /dev/rtc0 , -.I /dev/rtc1 -¤Ê¤É¤Î) -¥Ç¥Ð¥¤¥¹¤Ï (¥¯¥í¡¼¥º¤µ¤ì¤ë¤Þ¤Ç) 1 ²ó¤·¤«¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢ -Æɤ߹þ¤ßÀìÍѤǤ¢¤ë¡£ -.\"O On -.\"O .BR read (2) -.\"O and -.\"O .BR select (2) -.\"O the calling process is blocked until the next interrupt from that RTC -.\"O is received. -.BR read (2) -¤È -.BR select (2) -¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ï¡¢ -RTC ¤«¤é¤Î³ä¤ê¹þ¤ß¤ò¼õ¤±¼è¤ë¤Þ¤ÇÄä»ß (block) ¤µ¤ì¤ë¡£ -.\"O Following the interrupt, the process can read a long integer, of which -.\"O the least significant byte contains a bit mask encoding -.\"O the types of interrupt that occurred, -.\"O while the remaining 3 bytes contain the number of interrupts since the -.\"O last -.\"O .BR read (2). -³ä¤ê¹þ¤ß¤Î¸å¡¢¥×¥í¥»¥¹¤Ï long ·¿À°¿ô¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£ -¤³¤ÎÀ°¿ô¤ÎºÇ²¼°Ì¥Ð¥¤¥È¤ÏȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤Î¼ïÊ̤ò -¥³¡¼¥É²½¤·¤¿¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢ -»Ä¤ê¤Î 3 ¥Ð¥¤¥È¤ÏºÇ¸å¤Î -.BR read (2) -°Ê¹ß¤ËȯÀ¸¤·¤¿³ä¤ê¹þ¤ß¤Î²ó¿ô¤Ç¤¢¤ë¡£ -.\"O .SS ioctl(2) interface -.SS ioctl(2) ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ -.\"O The following -.\"O .BR ioctl (2) -.\"O requests are defined on file descriptors connected to RTC devices: -°Ê²¼¤Î -.BR ioctl (2) -¥ê¥¯¥¨¥¹¥È¤¬ RTC ¥Ç¥Ð¥¤¥¹¤ÎÀܳ¤µ¤ì¤¿ -¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë: -.TP -.B RTC_RD_TIME -.\"O Returns this RTC's time in the following structure: -RTC ¤Î»þ¹ï¤ò°Ê²¼¤Î¹½Â¤ÂΤÇÊÖ¤¹: +\fI/dev/rtc\fP (または \fI/dev/rtc0\fP, \fI/dev/rtc1\fP などの) デバイスは (クローズされるまで) 1 +回しかオープンすることができず、 読み込み専用である。 \fBread\fP(2) と \fBselect\fP(2) を呼び出したプロセスは、 RTC +からの割り込みを受け取るまで停止 (block) される。 割り込みの後、プロセスは long 型整数を読み出すことができる。 +この整数の最下位バイトは発生した割り込みの種別を コード化したビットマスクであり、 残りの 3 バイトは最後の \fBread\fP(2) +以降に発生した割り込みの回数である。 +.SS "ioctl(2) インタフェース" +以下の \fBioctl\fP(2) リクエストが RTC デバイスの接続された ファイルディスクリプタに対して定義されている: +.TP +\fBRTC_RD_TIME\fP +RTC の時刻を以下の構造体で返す: .IP .in +4n .nf @@ -222,207 +98,57 @@ struct rtc_time { int tm_mday; int tm_mon; int tm_year; -.\"O int tm_wday; /* unused */ - int tm_wday; /* ̤»ÈÍÑ */ -.\"O int tm_yday; /* unused */ - int tm_yday; /* ̤»ÈÍÑ */ -.\"O int tm_isdst; /* unused */ - int tm_isdst; /* ̤»ÈÍÑ */ + int tm_wday; /* 未使用 */ + int tm_yday; /* 未使用 */ + int tm_isdst; /* 未使用 */ }; .fi .in .IP -.\"O The fields in this structure have the same meaning and ranges as for the -.\"O .I tm -.\"O structure described in -.\"O .BR gmtime (3). -¤³¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Ï -.BR gmtime (3) -¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë -.I tm -¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ÈƱ¤¸°ÕÌ£¤ÇƱ¤¸ÈϰϤǤ¢¤ë¡£ -.\"O A pointer to this structure should be passed as the third -.\"O .BR ioctl (2) -.\"O argument. -¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò -.BR ioctl (2) -¤ÎÂè 3 °ú¤­¿ô¤È¤·¤ÆÅϤ¹¡£ -.TP -.B RTC_SET_TIME -.\"O Sets this RTC's time to the time specified by the -.\"O .I rtc_time -.\"O structure pointed to by the third -.\"O .BR ioctl (2) -.\"O argument. -.BR ioctl (2) -¤ÎÂè 3 °ú¤­¿ô¤¬»Ø¤¹ -.I rtc_time -¹½Â¤ÂΤÎÃͤò RTC »þ¹ï¤ËÀßÄꤹ¤ë¡£ -.\"O To set the -.\"O RTC's time the process must be privileged (i.e., have the -.\"O .B CAP_SYS_TIME -.\"O capability). -RTC »þ¹ï¤ÎÀßÄꤹ¤ë¾ì¹ç¡¢¥×¥í¥»¥¹¤ÏÆø¢ -(¤Ä¤Þ¤ê -.B CAP_SYS_TIME -¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ -.TP -.BR RTC_ALM_READ ", " RTC_ALM_SET -.\"O Read and set the alarm time, for RTCs that support alarms. -¥¢¥é¡¼¥à¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ -¥¢¥é¡¼¥à»þ¹ï¤ÎÆɤ߹þ¤ß¤ÈÀßÄê¤ò¹Ô¤¦¡£ -.\"O The alarm interrupt must be separately enabled or disabled using the -.\"O .BR RTC_AIE_ON ", " RTC_AIE_OFF -.\"O requests. -¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤Ï¡¢ -.BR RTC_AIE_ON ", " RTC_AIE_OFF -¤ò»È¤Ã¤Æ¡¢¤³¤ì¤È¤ÏÊ̤ËÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is a pointer to an -.\"O .I rtc_time -.\"O structure. -\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï¡¢ -.I rtc_time -¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ -.\"O Only the -.\"O .IR tm_sec , -.\"O .IR tm_min , -.\"O and -.\"O .I tm_hour -.\"O fields of this structure are used. -¤³¤Î¹½Â¤ÂΤΠ-.IR tm_sec , -.IR tm_min , -.I tm_hour -¥Õ¥£¡¼¥ë¥É¤Î¤ß¤¬»ÈÍѤµ¤ì¤ë¡£ -.TP -.BR RTC_IRQP_READ ", " RTC_IRQP_SET -.\"O Read and set the frequency for periodic interrupts, -.\"O for RTCs that support periodic interrupts. -¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ -¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤Î¼þÇÈ¿ô¤ÎÆɤ߹þ¤ß¤ÈÀßÄê¤ò¹Ô¤¦¡£ -.\"O The periodic interrupt must be separately enabled or disabled using the -.\"O .BR RTC_PIE_ON ", " RTC_PIE_OFF -.\"O requests. -¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤Ï¡¢ -.BR RTC_PIE_ON ", " RTC_PIE_OFF -¤ò»È¤Ã¤Æ¡¢¤³¤ì¤È¤ÏÊ̤ËÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is an -.\"O .I "unsigned long\ *" -.\"O or an -.\"O .IR "unsigned long" , -.\"O respectively. -\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï¡¢¤½¤ì¤¾¤ì -.I "unsigned long\ *" -¤È -.I "unsigned long" -¤Ç¤¢¤ë¡£ -.\"O The value is the frequency in interrupts per second. -.\"O The set of allowable frequencies is the multiples of two -.\"O in the range 2 to 8192. -¤³¤ÎÃÍ¤Ï 1 ÉÃÅö¤¿¤ê¤Î³ä¤ê¹þ¤ß¤Î²ó¿ô¤Ç¤¢¤ë¡£ -»ØÄê²Äǽ¤Ê¼þÇÈ¿ô¤Ï¡¢2 ¤Î¾è¿ô¤Ç 2 ¤«¤é 8192 ¤ÎÈϰϤǤ¢¤ë¡£ -.\"O Only a privileged process (i.e., one having the -.\"O .B CAP_SYS_RESOURCE -.\"O capability) can set frequencies above the value specified in -.\"O .IR /proc/sys/dev/rtc/max-user-freq . -Æø¢¥×¥í¥»¥¹ (¤Ä¤Þ¤ê -.B CAP_SYS_RESOURCE -¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬¡¢ -.I /proc/sys/dev/rtc/max-user-freq -¤Ë½ñ¤«¤ì¤¿¾åµ­¤Î¼þÇÈ¿ô¤òÀßÄê¤Ç¤­¤ë¡£ -.\"O (This file contains the value 64 by default.) -(¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç 64 ¤È¤¤¤¦Ãͤ¬½ñ¤«¤ì¤Æ¤¤¤ë)¡£ -.TP -.BR RTC_AIE_ON ", " RTC_AIE_OFF -.\"O Enable or disable the alarm interrupt, for RTCs that support alarms. -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is ignored. -¥¢¥é¡¼¥à¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ -¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ -\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ -.TP -.BR RTC_UIE_ON ", " RTC_UIE_OFF -.\"O Enable or disable the interrupt on every clock update, -.\"O for RTCs that support this once-per-second interrupt. -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is ignored. -1 ÉÃËè¤Î³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ -¥¯¥í¥Ã¥¯¹¹¿·Ëè¤Î³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ -\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ -.TP -.BR RTC_PIE_ON ", " RTC_PIE_OFF -.\"O Enable or disable the periodic interrupt, -.\"O for RTCs that support these periodic interrupts. -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is ignored. -¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë RTC ¤ËÂФ·¤Æ¡¢ -¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ -\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£ -.\"O Only a privileged process (i.e., one having the -.\"O .B CAP_SYS_RESOURCE -.\"O capability) can enable the periodic interrupt if the frequency is -.\"O currently set above the value specified in -.\"O .IR /proc/sys/dev/rtc/max-user-freq . -Æø¢¥×¥í¥»¥¹ (¤Ä¤Þ¤ê -.B CAP_SYS_RESOURCE -¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬¡¢ -¤½¤Î»þÅÀ¤Ç -.I /proc/sys/dev/rtc/max-user-freq -¤Ë¼þ´ü¤¬¾åµ­¤ÎÃͤ˻ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ -¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤òÍ­¸ú¤Ë¤Ç¤­¤ë¡£ -.TP -.BR RTC_EPOCH_READ ", " RTC_EPOCH_SET -.\"O Many RTCs encode the year in an 8-bit register which is either -.\"O interpreted as an 8-bit binary number or as a BCD number. -.\"O In both cases, -.\"O the number is interpreted relative to this RTC's Epoch. -¿¤¯¤Î RTC ¤Ïǯ¤ò 8 ¥Ó¥Ã¥È¤Î¥ì¥¸¥¹¥¿¤Ë¥³¡¼¥É²½¤¹¤ë¡£ -ǯ¤Ï 8 ¥Ó¥Ã¥È¤Î¥Ð¥¤¥Ê¥ê¿ô¤Þ¤¿¤Ï BCD ¿ô¤ËÊÑ´¹¤µ¤ì¤ë¡£ -¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¤½¤Î¿ôÃÍ¤Ï RTC ¤Îµª¸µ¤«¤éÁêÂÐÃͤËÊÑ´¹¤µ¤ì¤ë¡£ -.\"O The RTC's Epoch is -.\"O initialized to 1900 on most systems but on Alpha and MIPS it might -.\"O also be initialized to 1952, 1980, or 2000, depending on the value of -.\"O an RTC register for the year. -¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï RTC ¤Îµª¸µ¤Ï 1900 ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢ -Alpha ¤È MIPS ¤Ç¤Ï¡¢RTC ¥ì¥¸¥¹¥¿¤Îǯ¤ÎÃͤ˱þ¤¸¤Æ¡¢ -1952, 1980, 2000 ¤Î²¿¤ì¤«¤Ë½é´ü²½¤µ¤ì¤ë¡£ -.\"O With some RTCs, -.\"O these operations can be used to read or to set the RTC's Epoch, -.\"O respectively. -¤³¤ì¤é¤ÎÁàºî¤Ç¤½¤ì¤¾¤ì RTC ¤Îµª¸µ¤ÎÆɤ߹þ¤ß¤ÈÀßÄ꤬²Äǽ¤Ê RTC ¤â¤¢¤ë¡£ -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is a -.\"O .I "unsigned long\ *" -.\"O or a -.\"O .IR "unsigned long" , -.\"O respectively, and the value returned (or assigned) is the Epoch. -\fBioctl\fP(2) ¤ÎÂè 3 °ú¤­¿ô¤Ï¡¢¤½¤ì¤¾¤ì -.I "unsigned long\ *" -¤È -.I "unsigned long" -¤Ç¤¢¤ë¡£ -ÊÖ¤µ¤ì¤ëÃÍ (¤Þ¤¿¤Ï»ØÄꤵ¤ì¤ëÃÍ) ¤Ïµª¸µ¤Ç¤¢¤ë¡£ -.\"O To set the RTC's Epoch the process must be privileged (i.e., have the -.\"O .B CAP_SYS_TIME -.\"O capability). -RTC ¤Îµª¸µ¤òÀßÄꤹ¤ë¾ì¹ç¡¢¥×¥í¥»¥¹¤ÏÆø¢ (¤Ä¤Þ¤ê -.B CAP_SYS_TIME -¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ -.TP -.BR RTC_WKALM_RD ", " RTC_WKALM_SET -.\"O Some RTCs support a more powerful alarm interface, using these ioctls -.\"O to read or write the RTC's alarm time (respectively) with this structure: -RTC ¤ÎÃæ¤Ë¤Ï¤è¤ê¶¯ÎϤʥ¢¥é¡¼¥à¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤â¤Î¤â¤¢¤ê¡¢ -¤³¤ì¤é¤Î ioctl ¤ò»È¤¦¤³¤È¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤ÂÎ¤Ç -RTC ¤Î¥¢¥é¡¼¥à»þ¹ï¤ò (¤½¤ì¤¾¤ì) Æɤ߽ñ¤­¤Ç¤­¤ë: +この構造体のフィールドは \fBgmtime\fP(3) で説明されている \fItm\fP 構造体のフィールドと同じ意味で同じ範囲である。 +この構造体へのポインタを \fBioctl\fP(2) の第 3 引き数として渡す。 +.TP +\fBRTC_SET_TIME\fP +\fBioctl\fP(2) の第 3 引き数が指す \fIrtc_time\fP 構造体の値を RTC 時刻に設定する。 RTC +時刻の設定する場合、プロセスは特権 (つまり \fBCAP_SYS_TIME\fP ケーパビリティ) を持たなければならない。 +.TP +\fBRTC_ALM_READ\fP, \fBRTC_ALM_SET\fP +アラームがサポートされている RTC に対して、 アラーム時刻の読み込みと設定を行う。 アラーム割り込みは、 \fBRTC_AIE_ON\fP, +\fBRTC_AIE_OFF\fP を使って、これとは別に有効または無効にしなければならない。 \fBioctl\fP(2) の第 3 引き数は、 +\fIrtc_time\fP 構造体へのポインタでなければならない。 この構造体の \fItm_sec\fP, \fItm_min\fP, \fItm_hour\fP +フィールドのみが使用される。 +.TP +\fBRTC_IRQP_READ\fP, \fBRTC_IRQP_SET\fP +周期的な割り込みがサポートされている RTC に対して、 周期的な割り込みの周波数の読み込みと設定を行う。 周期的な割り込みは、 +\fBRTC_PIE_ON\fP, \fBRTC_PIE_OFF\fP を使って、これとは別に有効または無効にしなければならない。 \fBioctl\fP(2) の第 3 +引き数は、それぞれ \fIunsigned long\ *\fP と \fIunsigned long\fP である。 この値は 1 +秒当たりの割り込みの回数である。 指定可能な周波数は、2 の乗数で 2 から 8192 の範囲である。 特権プロセス (つまり +\fBCAP_SYS_RESOURCE\fP ケーパビリティを持つプロセス) のみが、 \fI/proc/sys/dev/rtc/max\-user\-freq\fP +に書かれた上記の周波数を設定できる。 (このファイルにはデフォルトで 64 という値が書かれている)。 +.TP +\fBRTC_AIE_ON\fP, \fBRTC_AIE_OFF\fP +アラームがサポートされている RTC に対して、 アラーム割り込みを有効または無効にする。 \fBioctl\fP(2) の第 3 引き数は無視される。 +.TP +\fBRTC_UIE_ON\fP, \fBRTC_UIE_OFF\fP +1 秒毎の割り込みがサポートされている RTC に対して、 クロック更新毎の割り込みを有効または無効にする。 \fBioctl\fP(2) の第 3 +引き数は無視される。 +.TP +\fBRTC_PIE_ON\fP, \fBRTC_PIE_OFF\fP +周期的な割り込みがサポートされている RTC に対して、 周期的な割り込みを有効または無効にする。 \fBioctl\fP(2) の第 3 +引き数は無視される。 特権プロセス (つまり \fBCAP_SYS_RESOURCE\fP ケーパビリティを持つプロセス) のみが、 その時点で +\fI/proc/sys/dev/rtc/max\-user\-freq\fP に周期が上記の値に指定されている場合に、 周期的な割り込みを有効にできる。 +.TP +\fBRTC_EPOCH_READ\fP, \fBRTC_EPOCH_SET\fP +多くの RTC は年を 8 ビットのレジスタにコード化する。 年は 8 ビットのバイナリ数または BCD 数に変換される。 どちらの場合でも、その数値は +RTC の紀元から相対値に変換される。 多くのシステムでは RTC の紀元は 1900 に初期化されるが、 Alpha と MIPS では、RTC +レジスタの年の値に応じて、 1952, 1980, 2000 の何れかに初期化される。 これらの操作でそれぞれ RTC の紀元の読み込みと設定が可能な +RTC もある。 \fBioctl\fP(2) の第 3 引き数は、それぞれ \fIunsigned long\ *\fP と \fIunsigned long\fP +である。 返される値 (または指定される値) は紀元である。 RTC の紀元を設定する場合、プロセスは特権 (つまり \fBCAP_SYS_TIME\fP +ケーパビリティ) を持たなければならない。 +.TP +\fBRTC_WKALM_RD\fP, \fBRTC_WKALM_SET\fP +RTC の中にはより強力なアラームインタフェースをサポートするものもあり、 これらの ioctl を使うことで、以下のような構造体で RTC +のアラーム時刻を (それぞれ) 読み書きできる: .PP .RS .in +4n @@ -436,134 +162,36 @@ struct rtc_wkalrm { .in .RE .IP -.\"O The -.\"O .I enabled -.\"O flag is used to enable or disable the alarm interrupt, -.\"O or to read its current status; when using these calls, -.\"O .BR RTC_AIE_ON " and " RTC_AIE_OFF -.\"O are not used. -.\"O The -.\"O .I pending -.\"O flag is used by -.\"O .B RTC_WKALM_RD -.\"O to report a pending interrupt -.\"O (so it's mostly useless on Linux, except when talking -.\"O to the RTC managed by EFI firmware). -.I enabled -¥Õ¥é¥°¤Ï¥¢¥é¡¼¥à³ä¤ê¹þ¤ß¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤·¤¿¤ê¡¢ -¸½ºß¤Î¾õÂÖ¤òÆɤ߹þ¤à¤Î¤Ë»ÈÍѤµ¤ì¤ë¡£ -¤³¤ì¤é¤Î¥Õ¥é¥°¤ò»È¤¦¾ì¹ç¡¢ -.BR RTC_AIE_ON " ¤È " RTC_AIE_OFF -¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£ -.I pending -¥Õ¥é¥°¤Ï -.B RTC_WKALM_RD -¤Ç»ÈÍѤµ¤ì¡¢½èÍýÂÔ¤Á¤Î³ä¤ê¹þ¤ß¤òɽ¼¨¤¹¤ë -(EFI ¥Õ¥¡¡¼¥à¥¦¥§¥¢¤Ç´ÉÍý¤µ¤ì¤ë RTC ¤ÈÄÌ¿®¤¹¤ë¤È¤­°Ê³°¡¢ -Linux ¤Ç¤Ï¤Û¤È¤ó¤ÉÌò¤ËΩ¤¿¤Ê¤¤)¡£ -.\"O The -.\"O .I time -.\"O field is as used with -.\"O .B RTC_ALM_READ -.\"O and -.\"O .B RTC_ALM_SET -.\"O except that the -.\"O .IR tm_mday , -.\"O .IR tm_mon , -.\"O and -.\"O .I tm_year -.\"O fields are also valid. -.I time -¥Õ¥£¡¼¥ë¥É¤Ï -.B RTC_ALM_READ -¤ä -.B RTC_ALM_SET -¤Î¾ì¹ç¤ÈƱ¤¸¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë¤¬¡¢ -.IR tm_mday , -.IR tm_mon , -.I tm_year -¥Õ¥£¡¼¥ë¥É¤âÍ­¸ú¤Ç¤¢¤ë¤È¤¤¤¦ÅÀ¤¬°Û¤Ê¤ë¡£ -.\"O A pointer to this structure should be passed as the third -.\"O .BR ioctl (2) -.\"O argument. -¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò -.BR ioctl (2) -¤ÎÂè 3 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ -.\"O .SH FILES -.SH ¥Õ¥¡¥¤¥ë -.IR /dev/rtc ", " -.IR /dev/rtc0 ", " -.\"O .IR /dev/rtc1 ", " -.I /dev/rtc1 -.\"O etc: RTC special character device files. -¤Ê¤É: -RTC Æü쥭¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë +\fIenabled\fP フラグはアラーム割り込みを有効または無効したり、 現在の状態を読み込むのに使用される。 これらのフラグを使う場合、 +\fBRTC_AIE_ON\fP と \fBRTC_AIE_OFF\fP は使用されない。 \fIpending\fP フラグは \fBRTC_WKALM_RD\fP +で使用され、処理待ちの割り込みを表示する (EFI ファームウェアで管理される RTC と通信するとき以外、 Linux ではほとんど役に立たない)。 +\fItime\fP フィールドは \fBRTC_ALM_READ\fP や \fBRTC_ALM_SET\fP の場合と同じように使用されるが、 \fItm_mday\fP, +\fItm_mon\fP, \fItm_year\fP フィールドも有効であるという点が異なる。 この構造体へのポインタを \fBioctl\fP(2) の第 3 +引き数として渡さなければならない。 +.SH ファイル +\fI/dev/rtc\fP, \fI/dev/rtc0\fP, \fI/dev/rtc1\fP など: RTC 特殊キャラクターデバイスファイル -.IR /proc/driver/rtc : -.\"O status of the (first) RTC. -(1 ¤ÄÌܤÎ) RTC ¤Î¾õÂÖ -.\"O .SH NOTES -.SH Ãí°Õ -.\"O When the kernel's system time is synchronized with an external -.\"O reference using -.\"O .BR adjtimex (2) -.\"O it will update a designated RTC periodically every 11 minutes. -.\"O To do so, the kernel has to briefly turn off periodic interrupts; -.\"O this might affect programs using that RTC. -¥«¡¼¥Í¥ë¤Î¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ò -.BR adjtimex (2) -¤ò»È¤Ã¤Æ³°Éô»²¾È¤ÇƱ´ü¤µ¤»¤ë¾ì¹ç¡¢ -.BR adjtimex (2) -¤Ï»ØÄꤵ¤ì¤¿ RTC ¤ò 11 ʬËè¤ËÄê´üŪ¤Ë¹¹¿·¤¹¤ë¡£ -¤³¤ì¤ò¹Ô¤¦¤¿¤á¥«¡¼¥Í¥ë¤Ï¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¤òû´ü´Ö̵¸ú¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¡£ -¤³¤ì¤Ï RTC ¤ò»È¤¦¥×¥í¥°¥é¥à¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¡£ +\fI/proc/driver/rtc\fP: (1 つ目の) RTC の状態 +.SH 注意 +カーネルのシステムクロックを \fBadjtimex\fP(2) を使って外部参照で同期させる場合、 \fBadjtimex\fP(2) は指定された RTC +を 11 分毎に定期的に更新する。 これを行うためカーネルは周期的な割り込みを短期間無効にする必要がある。 これは RTC +を使うプログラムに影響を与える。 -.\"O An RTC's Epoch has nothing to do with the POSIX Epoch which is only -.\"O used for the system clock. -RTC ¤Îµª¸µ¤Ï¡¢¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤Ç¤Î¤ß»ÈÍѤµ¤ì¤ë -POSIX ¤Îµª¸µ¤È¤Ï²¿¤Î´Ø·¸¤â¤Ê¤¤¡£ +RTC の紀元は、システムクロックでのみ使用される POSIX の紀元とは何の関係もない。 -.\"O If the year according to the RTC's Epoch and the year register is -.\"O less than 1970 it is assumed to be 100 years later, that is, between 2000 -.\"O and 2069. -RTC ¤Îµª¸µ¤Èǯ¤Î¥ì¥¸¥¹¥¿¤Ë´ð¤Å¤¯Ç¯¤¬ 1970 ̤Ëþ¤Ç¤¢¤ë¾ì¹ç¡¢ -100 ǯ¸å¡¢¤Ä¤Þ¤ê 2000 ¤«¤é 2069 ¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¤ë¡£ +RTC の紀元と年のレジスタに基づく年が 1970 未満である場合、 100 年後、つまり 2000 から 2069 であると仮定される。 -.\"O Some RTCs support "wildcard" values in alarm fields, to support -.\"O scenarios like periodic alarms at fifteen minutes after every hour, -.\"O or on the first day of each month. -.\"O Such usage is nonportable; -.\"O portable user space code only expects a single alarm interrupt, and -.\"O will either disable or reinitialize the alarm after receiving it. -RTC ¤ÎÃæ¤Ë¤Ï¥¢¥é¡¼¥à¥Õ¥£¡¼¥ë¥É¤Ë -¡Ö¥ï¥¤¥ë¥É¥«¡¼¥É¡×¤ÎÃͤò¥µ¥Ý¡¼¥È¤¹¤ë¤â¤Î¤â¤¢¤ê¡¢ -Ëè»þ 15 ʬ¤ä³Æ·î¤Î½éÆü¤Ê¤É¡¢Äê´üŪ¤Ê¥¢¥é¡¼¥à¤ò¹Ô¤¦¥·¥Ê¥ê¥ª¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ -¤³¤Î¤è¤¦¤Ê»È¤¤Êý¤Ï°Ü¿¢À­¤¬¤Ê¤¤¡£ -°Ü¿¢À­¤Î¹â¤¤¥æ¡¼¥¶¶õ´Ö¥³¡¼¥É¤Ç¤Ï¡¢Ã±ÆȤΥ¢¥é¡¼¥à³ä¤ê¹þ¤ß¤À¤±¤òÁÛÄꤷ¡¢ -³ä¤ê¹þ¤ß¤Î¼õ¿®¸å¤Ë¥¢¥é¡¼¥à¤ò̵¸ú¤Þ¤¿¤ÏºÆ½é´ü²½¤¹¤Ù¤­¤Ç¤¢¤ë¡£ +RTC の中にはアラームフィールドに 「ワイルドカード」の値をサポートするものもあり、 毎時 15 +分や各月の初日など、定期的なアラームを行うシナリオをサポートする。 このような使い方は移植性がない。 +移植性の高いユーザ空間コードでは、単独のアラーム割り込みだけを想定し、 割り込みの受信後にアラームを無効または再初期化すべきである。 -.\"O Some RTCs support periodic interrupts with periods that are multiples -.\"O of a second rather than fractions of a second; -.\"O multiple alarms; -.\"O programmable output clock signals; -.\"O nonvolatile memory; -.\"O and other hardware -.\"O capabilities that are not currently exposed by this API. -°Ê²¼¤Îµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤¹¤ë RTC ¤â¤¢¤ë¡£ -1 ÉäÎʬ¿ô¤Ç¤Ï¤Ê¤¯¡¢1 ÉäÎÇÜ¿ô¤ò¼þ´ü¤È¤¹¤ë¼þ´üŪ¤Ê³ä¤ê¹þ¤ß¡£ -Ê£¿ô¤Î¥¢¥é¡¼¥à¡£ -¥×¥í¥°¥é¥à²Äǽ¤Ê½ÐÎÏ¥¯¥í¥Ã¥¯¥·¥°¥Ê¥ë¡£ -ÉÔ´øȯÀ­ (nonvolatile) ¥á¥â¥ê¡£ -¤³¤Î API ¤Ç¸½ºßÄ󶡤·¤Æ¤¤¤Ê¤¤¡¢¤½¤Î¾¤Î¥Ï¡¼¥É¥¦¥§¥¢µ¡Ç½¡£ -.\"O .SH "SEE ALSO" -.SH ´ØÏ¢¹àÌÜ -.BR date (1), -.BR adjtimex (2), -.BR gettimeofday (2), -.BR settimeofday (2), -.BR stime (2), -.BR time (2), -.BR gmtime (3), -.BR time (7), -.BR hwclock (8), +以下の機能をサポートする RTC もある。 1 秒の分数ではなく、1 秒の倍数を周期とする周期的な割り込み。 複数のアラーム。 +プログラム可能な出力クロックシグナル。 不揮発性 (nonvolatile) メモリ。 この API で現在提供していない、その他のハードウェア機能。 +.SH 関連項目 +\fBdate\fP(1), \fBadjtimex\fP(2), \fBgettimeofday\fP(2), \fBsettimeofday\fP(2), +\fBstime\fP(2), \fBtime\fP(2), \fBgmtime\fP(3), \fBtime\fP(7), \fBhwclock\fP(8), /usr/src/linux/Documentation/rtc.txt +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。