EN JA
RTIME(3)
RTIME(3) FreeBSD Library Functions Manual RTIME(3)

名称

rtimeリモート時刻を取得する

ライブラリ

Standard C Library (libc, -lc)

書式

#include < sys/types.h>
#include < sys/time.h>
#include < netinet/in.h>

int
rtime( struct sockaddr_in *addrp, struct timeval *timep, struct timeval *timeout);

解説

rtime() 関数は、 addrp によって指されるアドレスのインターネット時刻サーバ (Internet Time Server) を調べて、 timep によって指された timeval 構造体にリモート時刻を返します。通常、時刻サーバを調べるとき、 UDP プロトコルが、使用されます。 timeout 引数は、ルーチンが、応答を待つとき、あきらめる前にどのくらいウェートする (待つ) べきであるかを指定します。しかしながら、 timeoutNULL として指定されるなら、ルーチンは、代わりに TCP を使用し、応答が、時刻サーバから受信されるまでブロックします。

戻り値

The rtime() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

関連項目

timed(8)
November 22, 1987 FreeBSD