OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / 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 .\"O .SH NAME
42 .\"O ftime \- return date and time
43 .SH Ì¾Á°
44 ftime \- ÆüÉդȻþ´Ö¤òÊÖ¤¹
45 .\"O .SH SYNOPSIS
46 .\"O .B "#include <sys/timeb.h>"
47 .\"O .sp
48 .\"O .BI "int ftime(struct timeb *" tp );
49 .SH ½ñ¼°
50 .B "#include <sys/timeb.h>"
51 .sp
52 .BI "int ftime(struct timeb *" tp );
53 .\"O .SH DESCRIPTION
54 .SH ÀâÌÀ
55 .\"O This function returns the current time as seconds and milliseconds
56 .\"O since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
57 .\"O The time is returned in
58 .\"O .IR tp ,
59 .\"O which is declared as follows:
60 ¤³¤Î´Ø¿ô¤Ï¸½ºß¤Î»þ¹ï¤ò¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC))
61 ¤«¤é¤ÎÉÿô¤È¥ß¥êÉÿô¤ÇÊÖ¤¹¡£
62 »þ¹ï¤Ï
63 .I tp
64 ¤ÇÊÖ¤µ¤ì¡¢¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
65 .sp
66 .in +4n
67 .nf
68 struct timeb {
69     time_t         time;
70     unsigned short millitm;
71     short          timezone;
72     short          dstflag;
73 };
74 .fi
75 .in
76 .LP
77 .\"O Here \fItime\fP is the number of seconds since the Epoch,
78 .\"O and \fImillitm\fP is the number of milliseconds since \fItime\fP
79 .\"O seconds since the Epoch.
80 .\"O The \fItimezone\fP field is the local timezone measured in minutes
81 .\"O of time west of Greenwich (with a negative value indicating minutes
82 .\"O east of Greenwich).
83 .\"O The \fIdstflag\fP field
84 .\"O is a flag that, if nonzero, indicates that Daylight Saving time
85 .\"O applies locally during the appropriate part of the year.
86 ¤³¤³¤Ç¡¢\fItime\fP ¤Ïµª¸µ (the Epoch) ¤«¤é¤ÎÉÿô¡¢
87 \fImillitm\fP ¤Ï µª¸µ¤«¤é \fItime\fP Éø夫¤é¤Î¥ß¥êÉÿô¤Ç¤¢¤ë¡£
88 \fItimezone\fP ¥Õ¥£¡¼¥ë¥É¤Ï¥°¥ê¥Ë¥Ã¥¸¤«¤éÀ¾¼þ¤ê¤Îʬ¤Ç·×¬¤µ¤ì¤ë
89 ¥í¡¼¥«¥ë¥¿¥¤¥à¥¾¡¼¥ó¤Ç¤¢¤ë(Éé¿ô¤Î¾ì¹ç¤Ï¥°¥ê¥Ë¥Ã¥¸¤«¤é¤ÎÅì²ó¤ê¤Îʬ¤ò
90 ¼¨¤¹)¡£
91 \fIdstflag\fP ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤â¤· 0 ¤Ç¤Ê¤±¤ì¤Ð°ìǯ¤Î°ìÉô¤Ç²Æ»þ´Ö¤¬
92 ¸ºß¤¹¤ë¤³¤È¤ò¼¨¤¹¥Õ¥é¥°¤Ç¤¢¤ë¡£
93 .LP
94 .\"O POSIX.1-2001 says that the contents of the \fItimezone\fP and \fIdstflag\fP
95 .\"O fields are unspecified; avoid relying on them.
96 POSIX.1-2001 ¤Ç¤Ï¡¢\fItimezone\fP ¤È \fIdstflag\fP ¤ÎÆâÍƤÏ̤ÄêµÁ¤Ç¤¢¤ë;
97 ¤³¤ì¤ËÍê¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£
98 \"O .SH "RETURN VALUE"
99 .SH ÊÖ¤êÃÍ
100 \"O This function always returns 0.
101 ¤³¤Î´Ø¿ô¤Ï¾ï¤Ë 0 ¤òÊÖ¤¹¡£
102 .\"O (POSIX.1-2001 specifies, and some systems document, a \-1 error return.)
103 (POSIX.1-2001 »ÅÍ͵ڤӤ¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Î¥É¥­¥å¥á¥ó¥È¤Ç¤Ï¡¢
104 ¥¨¥é¡¼»þ¤Ë \-1 ¤òÊÖ¤¹¡£)
105 \"O .SH "CONFORMING TO"
106 .SH ½àµò
107 4.2BSD, POSIX.1-2001.
108 .\"O POSIX.1-2008 removes the specification of
109 .\"O .BR ftime ().
110 POSIX.1-2008 ¤Ç¤Ï
111 .BR ftime ()
112 ¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
113
114 .\"O This function is obsolete.
115 .\"O Don't use it.
116 .\"O If the time in seconds
117 .\"O suffices,
118 .\"O .BR time (2)
119 .\"O can be used;
120 .\"O .BR gettimeofday (2)
121 .\"O gives microseconds;
122 .\"O .BR clock_gettime (2)
123 .\"O gives nanoseconds but is not as widely available.
124 ¤³¤Î´Ø¿ô¤Ï¸Å¤¤¤â¤Î¤Ç¤¢¤ë¡£»È¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
125 ÉÃñ°Ì¤Î»þ´Ö¤Ç½½Ê¬¤Ê¤é¡¢
126 .BR time (2)
127 ¤¬ÍøÍѤǤ­¤ë¡£
128 .BR gettimeofday (2)
129 ¤Ç¥Þ¥¤¥¯¥íÉä¬ÆÀ¤é¤ì¤ë¡£
130 .BR clock_gettime (2)
131 ¤Ç¥Ê¥ÎÉä¬ÆÀ¤é¤ì¤ë¤¬¡¢¹­¤¯ÍøÍѲÄǽ¤ÊÌõ¤Ç¤Ï¤Ê¤¤¡£
132 \"O .SH BUGS
133 .SH ¥Ð¥°
134 .LP
135 .\"O Under libc4 and libc5 the \fImillitm\fP field is meaningful.
136 .\"O But early glibc2 is buggy and returns 0 there;
137 \"O glibc 2.1.1 is correct again.
138 \fImillitm\fP ¥Õ¥£¡¼¥ë¥É¤Ï¡¢libc4 ¤È libc5 ¤Ç¤ÏÀµ¤·¤¯Æ°ºî¤¹¤ë¡£
139 ¤·¤«¤·¡¢½é´ü¤Î glibc2 ¤Ç¤Ï¥Ð¥°¤¬¤¢¤ê¡¢¾ï¤Ë 0 ¤òÊÖ¤¹¡£
140 glibc 2.1.1 ¤«¤éºÆ¤ÓÀµ¾ï¤Ë¤Ê¤Ã¤¿¡£
141 \"O .\" .SH HISTORY
142 \"O .\" The
143 \"O .\" .B ftime()
144 \"O .\" function appeared in 4.2BSD.
145 .\" .SH Îò»Ë
146 .\" .BR ftime ()
147 .\" ´Ø¿ô¤Ï 4.2BSD ¤Ë¸½¤ì¤¿¡£
148 \"O .SH "SEE ALSO"
149 .SH ´ØÏ¢¹àÌÜ
150 .BR gettimeofday (2),
151 .BR time (2)