OSDN Git Service

a66e68257a34747286c07ad87b2a1735c3cfb984
[linuxjm/LDP_man-pages.git] / release / man2 / time.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified Sat Jul 24 14:13:40 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Additions by Joseph S. Myers <jsm28@cam.ac.uk>, 970909
28 .\"
29 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
30 .\"         all rights reserved.
31 .\" Translated Thu Jun 26 21:11:17 JST 1997
32 .\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
33 .\" Modified Sun Mar 21 17:23:27 JST 1999
34 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\"
36 .\"WORD:        the Epoch               紀元
37 .\"
38 .TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual"
39 .SH 名前
40 time \- 秒単位の時間を得る
41 .SH 書式
42 .B #include <time.h>
43 .sp
44 .BI "time_t time(time_t *" t );
45 .SH 説明
46 .BR time ()
47 は、紀元 (Epoch; 1970-01-01 00:00:00 (UTC)) からの秒数で返す。
48
49 もし
50 .I t
51 が NULL でなかったら返り値は
52 .I t
53 の指しているメモリにも格納される。
54 .SH 返り値
55 成功した場合、紀元(the Epoch)からの経過秒数を返す。エラーの場合は
56 \fI((time_t)\ \-1)\fP を返し、\fIerrno\fP を設定する。
57 .SH エラー
58 .TP
59 .B EFAULT
60 .I t
61 がアクセス可能なアドレス空間の外を指している。
62 .SH 準拠
63 SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
64 .\" .br
65 .\" 4.3BSD ではこの関数は
66 .\" .BR gettimeofday (2)
67 .\" に取って代わられている。
68 POSIX にはエラー状態の規定はない。
69 .SH 注意
70 POSIX.1 では
71 .I 「紀元からの経過秒数 (seconds since the Epoch)」
72 は指定した時刻と紀元との間の秒数であると定義している。
73 ただしこのとき UTC (協定世界時) から秒を求める変換には、素朴な変換式
74 (閏秒を無視し、 4 で割り切れる年をすべて閏年とした式)
75 を用いるものとしている。
76 この値は紀元と現在時刻との間で実際に経過した秒数と同じではない。
77 なぜならば閏秒が存在するし、時計(clock)を標準時間(standard reference)に
78 同期させることを要求されていないからである。
79 この定義の意図は紀元からの経過秒数の解釈を一定にすることである。
80 より詳しい原理は POSIX.1 Annex B 2.2.2 を参照すること。
81 .SH 関連項目
82 .BR date (1),
83 .BR gettimeofday (2),
84 .BR ctime (3),
85 .BR ftime (3),
86 .BR time (7)