JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... dd(struct timeval * a , struct timeval * b , struct timeval * res ); void timersub(struct timeval * a , struct timeval * b , struct timeval ... * res ); void timerclear(struct timeval * tvp ); int timerisset(struct timeval * tvp ); int timercmp(struct timeval * a , struct timeval * b , CMP ); glibc 向けの ... cros (7) 参照): すべての関数は上記に記してあります: glibc 2.19 よりあと: _DEFAULT_SOURCE glibc 2.19 以前: _BSD_SOURCE 説明 timeval 構造体を操作するためのマクロが提供されています。 timeval 構造体は < sys/time.h > で以下のように定義されています。 struct t ... ... dd(struct timeval * a , struct timeval * b , struct timeval * res ); void timersub(struct timeval * a , struct timeval * b , struct timeval ... * res ); void timerclear(struct timeval * tvp ); int timerisset(struct timeval * tvp ); int timercmp(struct timeval * a , struct timeval * b , CMP ); glibc 向けの ... cros (7) 参照): すべての関数は上記に記してあります: glibc 2.19 よりあと: _DEFAULT_SOURCE glibc 2.19 以前: _BSD_SOURCE 説明 timeval 構造体を操作するためのマクロが提供されています。 timeval 構造体は < sys/time.h > で以下のように定義されています。 struct t ... ... dd(struct timeval * a , struct timeval * b , struct timeval * res ); void timersub(struct timeval * a , struct timeval * b , struct timeval ... * res ); void timerclear(struct timeval * tvp ); int timerisset(struct timeval * tvp ); int timercmp(struct timeval * a , struct timeval * b , CMP ); glibc 向けの ... cros (7) 参照): すべての関数は上記に記してあります: glibc 2.19 よりあと: _DEFAULT_SOURCE glibc 2.19 以前: _BSD_SOURCE 説明 timeval 構造体を操作するためのマクロが提供されています。 timeval 構造体は < sys/time.h > で以下のように定義されています。 struct t ... ... dd(struct timeval * a , struct timeval * b , struct timeval * res ); void timersub(struct timeval * a , struct timeval * b , struct timeval ... * res ); void timerclear(struct timeval * tvp ); int timerisset(struct timeval * tvp ); int timercmp(struct timeval * a , struct timeval * b , CMP ); glibc 向けの ... cros (7) 参照): すべての関数は上記に記してあります: glibc 2.19 よりあと: _DEFAULT_SOURCE glibc 2.19 以前: _BSD_SOURCE 説明 timeval 構造体を操作するためのマクロが提供されています。 timeval 構造体は < sys/time.h > で以下のように定義されています。 struct t ... ... dd(struct timeval * a , struct timeval * b , struct timeval * res ); void timersub(struct timeval * a , struct timeval * b , struct timeval ... * res ); void timerclear(struct timeval * tvp ); int timerisset(struct timeval * tvp ); int timercmp(struct timeval * a , struct timeval * b , CMP ); glibc 向けの ... cros (7) 参照): すべての関数は上記に記してあります: glibc 2.19 よりあと: _DEFAULT_SOURCE glibc 2.19 以前: _BSD_SOURCE 説明 timeval 構造体を操作するためのマクロが提供されています。 timeval 構造体は < sys/time.h > で以下のように定義されています。 struct t ... ... uct timeval *restrict tv , struct timezone *_Nullable restrict tz ); [[deprecated]] int settimeofday(const struct timeval * tv , const ... 以前: _BSD_SOURCE 説明 関数 gettimeofday () と settimeofday () は時刻とタイムゾーンを取得または設定します。 tv 引数は struct timeval ( < sys/time.h > で定義)です: struct timeval { time_t tv_sec; /* 秒 */ suseconds_t tv_usec; /* マイクロ秒 */ }; これにより ... ettimeofday () の代わりに clock_settime (2) を使用すべきです。POSIX.1-2024 は gettimeofday () を削除しました。 昔は struct timeval のフィールドは long 型でした。 tz_dsttime フィールド Linux 以外のカーネルで、glibc では struct timezone の tz_dsttime フィ ... ... uct timeval *restrict tv , struct timezone *_Nullable restrict tz ); [[deprecated]] int settimeofday(const struct timeval * tv , const ... 以前: _BSD_SOURCE 説明 関数 gettimeofday () と settimeofday () は時刻とタイムゾーンを取得または設定します。 tv 引数は struct timeval ( < sys/time.h > で定義)です: struct timeval { time_t tv_sec; /* 秒 */ suseconds_t tv_usec; /* マイクロ秒 */ }; これにより ... ettimeofday () の代わりに clock_settime (2) を使用すべきです。POSIX.1-2024 は gettimeofday () を削除しました。 昔は struct timeval のフィールドは long 型でした。 tz_dsttime フィールド Linux 以外のカーネルで、glibc では struct timezone の tz_dsttime フィ ... ... c_timeval * timeout ); 説明 この関数は RFC 868 に記述されているタイムサーバプロトコルを使用し、 リモートマシンから時刻を取得する。 タ ... netdb.h > static int use_tcp = 0; static char *servername = "linux"; int main(void) { struct sockaddr_in name; struct rpc_timeval time1 = {0,0}; struct rpc_timeval timeout = {1,0}; struct hostent *hent; int ret; memset(&name, 0, sizeof(name)); sethoste ... ... s/types.h > #include < unistd.h > int select(int nfds , fd_set * readfds , fd_set * writefds , fd_set * exceptfds , struct timeval * timeout ); void FD_CLR(int fd , fd_set * set ); int FD_ISSET(int fd , fd_set * set ); void FD_SET(int fd , fd_set * set ... lect () と pselect () の動作は同じであるが、以下の 3 点が異なる: (i) select () では、タイムアウト時間の指定に構造体 struct timeval (秒・マイクロ秒単位) を用いる。 一方、 pselect () 関数では、構造体 struct timespec (秒・ナノ秒単位) を用いる。 (ii) select ... はシステムクロックの粒度に切り上げられ、 カーネルのスケジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 timeval 構造体の両方のフィールドが 0 の場合、 select () はすぐに復帰する (この機能はポーリング (polling) を行うのに便利である)。 t ... ... s/types.h > #include < unistd.h > int select(int nfds , fd_set * readfds , fd_set * writefds , fd_set * exceptfds , struct timeval * timeout ); void FD_CLR(int fd , fd_set * set ); int FD_ISSET(int fd , fd_set * set ); void FD_SET(int fd , fd_set * set ... lect () と pselect () の動作は同じであるが、以下の 3 点が異なる: (i) select () では、タイムアウト時間の指定に構造体 struct timeval (秒・マイクロ秒単位) を用いる。 一方、 pselect () 関数では、構造体 struct timespec (秒・ナノ秒単位) を用いる。 (ii) select ... はシステムクロックの粒度に切り上げられ、 カーネルのスケジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 timeval 構造体の両方のフィールドが 0 の場合、 select () はすぐに復帰する (この機能はポーリング (polling) を行うのに便利である)。 t ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。