OSDN Git Service

c130ddeaea94f0d4798470328454259a75f75ba2
[linuxjm/LDP_man-pages.git] / release / man3 / timeradd.3
1 .\" Copyright (c) 2007 by Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" 2007-07-31, mtk, Created
24 .\"
25 .\" Japanese Version Copyright (c) 2007  Akihiro MOTOKI
26 .\"         all rights reserved.
27 .\" Translated 2007-10-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.66
28 .\" Updated 2009-04-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.20
29 .\" 
30 .TH TIMERADD 3 2010-02-25 "Linux" "Linux Programmer's Manual"
31 .SH Ì¾Á°
32 timeradd, timersub, timercmp, timerclear, timerisset \- timeval ¤ÎÁàºî
33 .SH ½ñ¼°
34 .nf
35 .B #include <sys/time.h>
36
37 .BI "void timeradd(struct timeval *" a ", struct timeval *" b ,
38 .BI "              struct timeval *" res );
39
40 .BI "void timersub(struct timeval *" a ", struct timeval *" b ,
41 .BI "              struct timeval *" res );
42
43 .BI "void timerclear(struct timeval *" tvp );
44
45 .BI "int timerisset(struct timeval *" tvp );
46
47 .BI "int timercmp(struct timeval *" a ", struct timeval *" b ", " CMP );
48 .fi
49 .sp
50 .in -4n
51 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
52 .RB ( feature_test_macros (7)
53 »²¾È):
54 .in
55 .sp
56 ¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô:
57 _BSD_SOURCE
58 .SH ÀâÌÀ
59 .I timeval
60 ¹½Â¤ÂΤòÁàºî¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£
61 .I timeval
62 ¹½Â¤ÂΤÏ
63 .I <sys/time.h>
64 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
65 .sp
66 .in +4n
67 .nf
68 struct timeval {
69     time_t      tv_sec;     /* Éà*/
70     suseconds_t tv_usec;    /* ¥Þ¥¤¥¯¥íÉà*/
71 };
72 .fi
73 .in
74 .PP
75 .BR timeradd ()
76 ¤Ï¡¢
77 .I a
78 ¤È
79 .I b
80 ¤Î»þ¹ïÃͤò²Ã»»¤·¡¢¤½¤Î¹ç·×¤ò
81 .I res
82 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë
83 .I timeval
84 ¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£·ë²Ì¤Ï¡¢
85 .I res\->tv_usec
86 ¤ÎÃͤ¬ 0 ¤«¤é 999,999 ¤ÎÈϰϤËÆþ¤ë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤ë¡£
87
88 .BR timersub ()
89 ¤Ï¡¢
90 .I a
91 ¤Î»þ¹ïÃͤ«¤é
92 .I b
93 ¤Î»þ¹ïÃͤò¸º»»¤·¡¢¤½¤Î·ë²Ì¤ò
94 .I res
95 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë
96 .I timeval
97 ¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£·ë²Ì¤Ï¡¢
98 .I res\->tv_usec
99 ¤ÎÃͤ¬ 0 ¤«¤é 999,999 ¤ÎÈϰϤËÆþ¤ë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤ë¡£
100
101 .BR timerclear ()
102 ¤Ï
103 .I tvp
104 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë
105 .I timeval
106 ¹½Â¤ÂΤò 0 ¤ÇËä¤á¤ë¡£
107 0 ¤ÇËä¤á¤é¤ì¤¿
108 .I timeval
109 ¹½Â¤ÂΤϡ¢»þ¹ïµª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤òɽ¤¹¡£
110
111 .BR timerisset ()
112 ¤Ï¡¢
113 .I tvp
114 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë
115 .I timeval
116 ¹½Â¤ÂΤΤ¤¤º¤ì¤«°ìÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 °Ê³°¤ÎÃͤ¬Æþ¤Ã¤Æ¤¤¤ì¤Ð¡¢
117 ¿¿ (0 °Ê³°) ¤òÊÖ¤¹¡£
118
119 .BR timercmp ()
120 ¤Ï
121 .I a
122 ¤È
123 .I b
124 ¤Î»þ¹ïÃͤòÈæ³Ó±é»»»Ò
125 .I CMP
126 ¤ò»È¤Ã¤ÆÈæ³Ó¤·¡¢Èæ³Ó·ë²Ì¤Ë´ð¤Å¤­¡¢¿¿ (0 °Ê³°) ¤«µ¶ (0) ¤òÊÖ¤¹¡£
127 (Linux/glibc ¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤¤¬)
128 ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
129 .BRr timercmp ()
130 ¤Î¼ÂÁõ¤¬¤ª¤«¤·¤¯¡¢
131 .\" HP-UX, Tru64, Irix ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
132 .\"#define timercmp(tvp, uvp, cmp) \
133 .\"    ((tvp)->tv_sec cmp (uvp)->tv_sec || \
134 .\"    (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
135 .I CMP
136 ¤Ë
137 .IR >= ,
138 .IR <= ,
139 .I ==
140 ¤ò»ØÄꤹ¤ë¤ÈÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£
141 °Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢
142 Âå¤ï¤ê¤Ë°Ê²¼¤ò»È¤¦¤³¤È¡£
143
144     !timercmp(..., <)
145     !timercmp(..., >)
146     !timercmp(..., !=)
147 .SH ÊÖ¤êÃÍ
148 .BR timerisset ()
149 ¤È
150 .BR timercmp ()
151 ¤Ï¡¢¿¿ (0 °Ê³°) ¤«µ¶ (0) ¤òÊÖ¤¹¡£
152 .BR
153 .SH ¥¨¥é¡¼
154 ¥¨¥é¡¼¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
155 .SH ½àµò
156 POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£
157 ¤Û¤È¤ó¤É¤Î BSD Í³Íè¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¸ºß¤¹¤ë¡£
158 .SH ´ØÏ¢¹àÌÜ
159 .BR gettimeofday (2),
160 .BR time (7)