1 .\" Copyright (c) 2007 by Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" 2007-07-31, mtk, Created
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
30 .TH TIMERADD 3 2010-02-25 "Linux" "Linux Programmer's Manual"
32 timeradd, timersub, timercmp, timerclear, timerisset \- timeval の操作
35 .B #include <sys/time.h>
37 .BI "void timeradd(struct timeval *" a ", struct timeval *" b ,
38 .BI " struct timeval *" res );
40 .BI "void timersub(struct timeval *" a ", struct timeval *" b ,
41 .BI " struct timeval *" res );
43 .BI "void timerclear(struct timeval *" tvp );
45 .BI "int timerisset(struct timeval *" tvp );
47 .BI "int timercmp(struct timeval *" a ", struct timeval *" b ", " CMP );
52 .RB ( feature_test_macros (7)
60 構造体を操作するためのマクロが提供されている。
69 time_t tv_sec; /* 秒 */
70 suseconds_t tv_usec; /* マイクロ秒 */
86 の値が 0 から 999,999 の範囲に入るように正規化される。
99 の値が 0 から 999,999 の範囲に入るように正規化される。
109 構造体は、時刻紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) を表す。
116 構造体のいずれか一方のフィールドに 0 以外の値が入っていれば、
126 を使って比較し、比較結果に基づき、真 (0 以外) か偽 (0) を返す。
127 (Linux/glibc はそうではないが)
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)
151 は、真 (0 以外) か偽 (0) を返す。
157 ほとんどの BSD 由来のシステムには存在する。
159 .BR gettimeofday (2),