117 lines
		
	
	
	
		
			3.9 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
			
		
		
	
	
			117 lines
		
	
	
	
		
			3.9 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
| .\"	%NetBSD: inittodr.9,v 1.2 1996/03/27 21:16:06 jtc Exp %
 | |
| .\"
 | |
| .\" Copyright (c) 1994 Christopher G. Demetriou
 | |
| .\" 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.
 | |
| .\" 3. All advertising materials mentioning features or use of this software
 | |
| .\"    must display the following acknowledgement:
 | |
| .\"      This product includes software developed by Christopher G. Demetriou
 | |
| .\"      for the NetBSD Project.
 | |
| .\" 3. The name of the author may not be used to endorse or promote products
 | |
| .\"    derived from this software without specific prior written permission
 | |
| .\"
 | |
| .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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/share/man/man9/inittodr.9,v 1.11 2003/10/23 02:33:03 hmp Exp %
 | |
| .\" $FreeBSD$
 | |
| .\"
 | |
| .Dd March 22, 1997
 | |
| .Dt INITTODR 9
 | |
| .Os
 | |
| .Sh 名称
 | |
| .Nm inittodr
 | |
| .Nd システムタイムの初期化
 | |
| .Sh 書式
 | |
| .In sys/types.h
 | |
| .In sys/systm.h
 | |
| .Ft void
 | |
| .Fn inittodr "time_t base"
 | |
| .Sh 解説
 | |
| .Fn inittodr
 | |
| 関数は時刻を決定しシステムクロックの設定を行います。
 | |
| システムのバッテリバックアップクロックおよび
 | |
| .Fa base
 | |
| で与えられるルートファイルシステムから得られる時刻
 | |
| を検査する発見方法を使用して正しい時刻の取得を試みます。
 | |
| .Fa base
 | |
| の値を得る方法は、ルートファイルシステムのタイプに依存して変化するでしょう。
 | |
| 下記の発見方法が使用されます。
 | |
| .Bl -bullet
 | |
| .It
 | |
| バッテリバックアップクロックが妥当な時刻であれば、これが使用されます。
 | |
| .\" .It
 | |
| .\" If the battery-backed clock does not have a valid time, and
 | |
| .\" the time provided in
 | |
| .\" .Fa base
 | |
| .\" is within reason,
 | |
| .\" .Fa base
 | |
| .\" is used as the current time.
 | |
| .\" .It
 | |
| .\" If the battery-backed clock appears invalid, and
 | |
| .\" .Fa base
 | |
| .\" appears non-sensical or was not provided (was given as zero),
 | |
| .\" a arbitrary base (typically some time in the late 1970s)
 | |
| .\" will be used.
 | |
| .It
 | |
| バッテリバックアップクロックが妥当な時刻でなければ、
 | |
| .Fa base
 | |
| で与えられた時刻が使用されます。
 | |
| .El
 | |
| .Pp
 | |
| 一度システムタイムが決定されると、これが
 | |
| .Va time
 | |
| 変数に格納されます。
 | |
| .Sh 診断
 | |
| システムタイムの計算に問題があった場合は、
 | |
| .Fn inittodr
 | |
| 関数は診断メッセージを出力します。
 | |
| 出力される診断メッセージには下記の状態が含まれます。
 | |
| .Bl -bullet
 | |
| .It
 | |
| バッテリバックアップクロックが無意味のようである。
 | |
| .\" .It
 | |
| .\" The
 | |
| .\" .Fa base
 | |
| .\" time appears nonsensical.
 | |
| .\" .It
 | |
| .\" The
 | |
| .\" .Fa base
 | |
| .\" time and the battery-backed clock's time differ by a large amount.
 | |
| .El
 | |
| .Sh 関連項目
 | |
| .Xr resettodr 9 ,
 | |
| .Xr time 9
 | |
| .Sh バグ
 | |
| 多くのシステムで
 | |
| .Fn inittodr
 | |
| は、
 | |
| 年、月、日、時、分、秒で表現される時刻から、秒で表現される
 | |
| .Va time
 | |
| に変換しなければなりません。
 | |
| 多くの実装ではコードの共有が可能ですが、共有していません。
 | |
| .Pp
 | |
| それぞれのシステムの正確な時刻取得のための発見方法は、わずかに異なります。
 | |
| .Pp
 | |
| .Fx
 | |
| の実装は、
 | |
| バッテリバックアップクロックを使用できない場合は、
 | |
| .Fa base
 | |
| で与えられた時刻をもっとうまく検証するべきでしょう。
 | |
| 現在は無条件にシステムタイムをこの値に設定します。
 |