xref: /freebsd/lib/libc/rpc/rtime.3 (revision a0409676120c1e558d0ade943019934e0f15118d)
1.\" @(#)rtime.3n	2.1 88/08/08 4.0 RPCSRC; from 1.5 88/02/08 SMI
2.\" $FreeBSD$
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
23The
24.Fn rtime
25function
26consults the Internet Time Server at the address pointed to by
27.Fa addrp
28and returns the remote time in the
29.Vt timeval
30struct pointed to by
31.Fa timep .
32Normally, the
33.Tn UDP
34protocol is used when consulting the Time Server.
35The
36.Fa timeout
37argument specifies how long the
38routine should wait before giving
39up when waiting for a reply.
40If
41.Fa timeout
42is specified as
43.Dv NULL ,
44however, the routine will instead use
45.Tn TCP
46and block until a reply is received from the time server.
47.Sh RETURN VALUES
48.Rv -std rtime
49.Sh SEE ALSO
50.Xr timed 8
51