Initial import from FreeBSD RELENG_4:
[games.git] / lib / libc / rpc / rtime.3
1 .\" @(#)rtime.3n        2.1 88/08/08 4.0 RPCSRC; from 1.5 88/02/08 SMI
2 .\" $FreeBSD: src/lib/libc/rpc/rtime.3,v 1.4.2.2 2001/12/14 18:33:57 ru Exp $
3 .\"
4 .Dd November 22, 1987
5 .Dt RTIME 3
6 .Os
7 .Sh NAME
8 .Nm rtime
9 .Nd "get remote time"
10 .Sh LIBRARY
11 .Lb libc
12 .Sh SYNOPSIS
13 .In sys/types.h
14 .In sys/time.h
15 .In netinet/in.h
16 .Ft int
17 .Fo rtime
18 .Fa "struct sockaddr_in *addrp"
19 .Fa "struct timeval *timep"
20 .Fa "struct timeval *timeout"
21 .Fc
22 .Sh DESCRIPTION
23 .Fn rtime
24 consults the Internet Time Server at the address pointed to by
25 .Fa addrp
26 and returns the remote time in the
27 .Vt timeval
28 struct pointed to by
29 .Fa timep .
30 Normally, the
31 .Tn UDP
32 protocol is used when consulting the Time Server.
33 The
34 .Fa timeout
35 parameter specifies how long the
36 routine should wait before giving
37 up when waiting for a reply.
38 If
39 .Fa timeout
40 is specified as
41 .Dv NULL ,
42 however, the routine will instead use
43 .Tn TCP
44 and block until a reply is received from the time server.
45 .Sh RETURN VALUES
46 .Rv -std rtime
47 .Sh SEE ALSO
48 .Xr timed 8