xref: /freebsd/lib/libc/rpc/rtime.3 (revision 60a517b66a69b8c011b04063ef63a938738719bd)
1.\"
2.Dd May 13, 2021
3.Dt RTIME 3
4.Os
5.Sh NAME
6.Nm rtime
7.Nd "get remote time"
8.Sh LIBRARY
9.Lb libc
10.Sh SYNOPSIS
11.In sys/types.h
12.In sys/time.h
13.In netinet/in.h
14.Ft int
15.Fo rtime
16.Fa "struct sockaddr_in *addrp"
17.Fa "struct timeval *timep"
18.Fa "struct timeval *timeout"
19.Fc
20.Sh DESCRIPTION
21The
22.Fn rtime
23function
24consults the Internet Time Server at the address pointed to by
25.Fa addrp
26and returns the remote time in the
27.Vt timeval
28struct pointed to by
29.Fa timep .
30Normally, the
31.Tn UDP
32protocol is used when consulting the Time Server.
33The
34.Fa timeout
35argument specifies how long the
36routine should wait before giving
37up when waiting for a reply.
38If
39.Fa timeout
40is specified as
41.Dv NULL ,
42however, the routine will instead use
43.Tn TCP
44and block until a reply is received from the time server.
45.Sh RETURN VALUES
46.Rv -std rtime
47