OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[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 .\" (michael@moria.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., 59 Temple Place, Suite 330, Boston, MA 02111,
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 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH FTIME 3 2010\-02\-25 GNU "Linux Programmer's Manual"
37 .SH 名前
38 ftime \- 日付と時間を返す
39 .SH 書式
40 \fB#include <sys/timeb.h>\fP
41 .sp
42 \fBint ftime(struct timeb *\fP\fItp\fP\fB);\fP
43 .SH 説明
44 この関数は現在の時刻を、紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC))  からの秒数とミリ秒数で返す。 時刻は
45 \fItp\fP で返され、これは以下のように定義されている:
46 .sp
47 .in +4n
48 .nf
49 struct timeb {
50     time_t         time;
51     unsigned short millitm;
52     short          timezone;
53     short          dstflag;
54 };
55 .fi
56 .in
57 .LP
58 ここで、\fItime\fP は紀元 (the Epoch) からの秒数、 \fImillitm\fP は 紀元から \fItime\fP 秒後からのミリ秒数である。
59 \fItimezone\fP フィールドはグリニッジから西周りの分で計測される ローカルタイムゾーンである(負数の場合はグリニッジからの東回りの分を 示す)。
60 \fIdstflag\fP フィールドは、もし 0 でなければ一年の一部で夏時間が 存在することを示すフラグである。
61 .LP
62 POSIX.1\-2001 では、\fItimezone\fP と \fIdstflag\fP の内容は未定義である; これに頼るのは避けること。
63 .SH 返り値
64 この関数は常に 0 を返す。 (POSIX.1\-2001 仕様及びいくつかのシステムのドキュメントでは、 エラー時に \-1 を返す。)
65 .SH 準拠
66 4.2BSD, POSIX.1\-2001.  POSIX.1\-2008 では \fBftime\fP()  の仕様が削除されている。
67
68 この関数は古いものである。使ってはならない。 秒単位の時間で十分なら、 \fBtime\fP(2)  が利用できる。 \fBgettimeofday\fP(2)
69 でマイクロ秒が得られる。 \fBclock_gettime\fP(2)  でナノ秒が得られるが、広く利用可能な訳ではない。
70 .SH バグ
71 .LP
72 .\" .SH HISTORY
73 .\" The
74 .\" .BR ftime ()
75 .\" function appeared in 4.2BSD.
76 \fImillitm\fP フィールドは、libc4 と libc5 では正しく動作する。 しかし、初期の glibc2 ではバグがあり、常に 0 を返す。
77 glibc 2.1.1 から再び正常になった。
78 .SH 関連項目
79 \fBgettimeofday\fP(2), \fBtime\fP(2)