1RTIME(3) BSD Library Functions Manual RTIME(3)
2
4 rtime — get remote time
5
7 #include <sys/types.h>
8 #include <sys/time.h>
9 #include <netinet/in.h>
10
11 int
12 rtime(struct sockaddr_in *addrp, struct timeval *timep,
13 struct timeval *timeout);
14
16 The rtime() function consults the Internet Time Server at the address
17 pointed to by addrp and returns the remote time in the timeval struct
18 pointed to by timep. Normally, the UDP protocol is used when consulting
19 the Time Server. The timeout argument specifies how long the routine
20 should wait before giving up when waiting for a reply. If timeout is
21 specified as NULL, however, the routine will instead use TCP and block
22 until a reply is received from the time server.
23
25 The rtime() function returns the value 0 if successful; otherwise the
26 value -1 is returned and the global variable errno is set to indicate the
27 error.
28
30 The rtime() function is part of libtirpc.
31
32BSD November 22, 1987 BSD