OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man3 / ftime.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1993 Michael Haardt
4 .\" (u31b3hs@pool.informatik.rwth-aachen.de)
5 .\" Fri Apr  2 11:32:09 MET DST 1993
6 .\"
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
11 .\"
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
16 .\"
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 .\" GNU General Public License for more details.
21 .\"
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual; if not, write to the Free
24 .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
25 .\" USA.
26 .\"
27 .\" Modified Sat Jul 24 14:23:14 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Sun Oct 18 17:31:43 1998 by Andries Brouwer (aeb@cwi.nl)
29 .\" 2008-06-23, mtk, minor rewrites, added some details
30 .\"
31 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
32 .\"     all rights reserved.
33 .\" Translated Thu Dec 25 10:53:32 JST 1997
34 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
35 .\"
36 .\" Updated Tue Jul  8 JST 1999 by Kentaro Shirakata <argrath@ub32.org>
37 .\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
38 .\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata <argrath@ub32.org>
39 .\"
40 .TH FTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual"
41 .SH 名前
42 ftime \- 日付と時間を返す
43 .SH 書式
44 .B "#include <sys/timeb.h>"
45 .sp
46 .BI "int ftime(struct timeb *" tp );
47 .SH 説明
48 この関数は現在の時刻を、紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC))
49 からの秒数とミリ秒数で返す。
50 時刻は
51 .I tp
52 で返され、これは以下のように定義されている:
53 .sp
54 .in +4n
55 .nf
56 struct timeb {
57     time_t         time;
58     unsigned short millitm;
59     short          timezone;
60     short          dstflag;
61 };
62 .fi
63 .in
64 .LP
65 ここで、\fItime\fP は紀元 (the Epoch) からの秒数、
66 \fImillitm\fP は 紀元から \fItime\fP 秒後からのミリ秒数である。
67 \fItimezone\fP フィールドはグリニッジから西周りの分で計測される
68 ローカルタイムゾーンである(負数の場合はグリニッジからの東回りの分を
69 示す)。
70 \fIdstflag\fP フィールドは、もし 0 でなければ一年の一部で夏時間が
71 存在することを示すフラグである。
72 .LP
73 POSIX.1-2001 では、\fItimezone\fP と \fIdstflag\fP の内容は未定義である;
74 これに頼るのは避けること。
75 \"O .SH "RETURN VALUE"
76 .SH 返り値
77 \"O This function always returns 0.
78 この関数は常に 0 を返す。
79 (POSIX.1-2001 仕様及びいくつかのシステムのドキュメントでは、
80 エラー時に \-1 を返す。)
81 \"O .SH "CONFORMING TO"
82 .SH 準拠
83 4.2BSD, POSIX.1-2001.
84 POSIX.1-2008 では
85 .BR ftime ()
86 の仕様が削除されている。
87
88 この関数は古いものである。使ってはならない。
89 秒単位の時間で十分なら、
90 .BR time (2)
91 が利用できる。
92 .BR gettimeofday (2)
93 でマイクロ秒が得られる。
94 .BR clock_gettime (2)
95 でナノ秒が得られるが、広く利用可能な訳ではない。
96 \"O .SH BUGS
97 .SH バグ
98 .LP
99 \"O glibc 2.1.1 is correct again.
100 \fImillitm\fP フィールドは、libc4 と libc5 では正しく動作する。
101 しかし、初期の glibc2 ではバグがあり、常に 0 を返す。
102 glibc 2.1.1 から再び正常になった。
103 \"O .\" .SH HISTORY
104 \"O .\" The
105 \"O .\" .B ftime()
106 \"O .\" function appeared in 4.2BSD.
107 .\" .SH 歴史
108 .\" .BR ftime ()
109 .\" 関数は 4.2BSD に現れた。
110 \"O .SH "SEE ALSO"
111 .SH 関連項目
112 .BR gettimeofday (2),
113 .BR time (2)