1997-05-28 05:00:11 +00:00
|
|
|
.\" @(#)rtime.3n 2.1 88/08/08 4.0 RPCSRC; from 1.5 88/02/08 SMI
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1999-07-12 20:50:10 +00:00
|
|
|
.\"
|
2001-01-17 18:26:21 +00:00
|
|
|
.Dd November 22, 1987
|
|
|
|
.Dt RTIME 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm rtime
|
|
|
|
.Nd "get remote time"
|
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libc
|
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In sys/types.h
|
|
|
|
.In sys/time.h
|
|
|
|
.In netinet/in.h
|
2001-01-17 18:26:21 +00:00
|
|
|
.Ft int
|
|
|
|
.Fo rtime
|
|
|
|
.Fa "struct sockaddr_in *addrp"
|
|
|
|
.Fa "struct timeval *timep"
|
|
|
|
.Fa "struct timeval *timeout"
|
|
|
|
.Fc
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Fn rtime
|
1997-05-28 05:00:11 +00:00
|
|
|
consults the Internet Time Server at the address pointed to by
|
2001-01-17 18:26:21 +00:00
|
|
|
.Fa addrp
|
1997-05-28 05:00:11 +00:00
|
|
|
and returns the remote time in the
|
2001-01-17 18:26:21 +00:00
|
|
|
.Vt timeval
|
1997-05-28 05:00:11 +00:00
|
|
|
struct pointed to by
|
2001-01-17 18:26:21 +00:00
|
|
|
.Fa timep .
|
1997-05-28 05:00:11 +00:00
|
|
|
Normally, the
|
2001-01-17 18:26:21 +00:00
|
|
|
.Tn UDP
|
2000-03-02 09:14:21 +00:00
|
|
|
protocol is used when consulting the Time Server.
|
|
|
|
The
|
2001-01-17 18:26:21 +00:00
|
|
|
.Fa timeout
|
1997-05-28 05:00:11 +00:00
|
|
|
parameter specifies how long the
|
|
|
|
routine should wait before giving
|
2001-01-17 18:26:21 +00:00
|
|
|
up when waiting for a reply.
|
|
|
|
If
|
|
|
|
.Fa timeout
|
1997-05-28 05:00:11 +00:00
|
|
|
is specified as
|
2001-01-17 18:26:21 +00:00
|
|
|
.Dv NULL ,
|
1997-05-28 05:00:11 +00:00
|
|
|
however, the routine will instead use
|
2001-01-17 18:26:21 +00:00
|
|
|
.Tn TCP
|
1997-05-28 05:00:11 +00:00
|
|
|
and block until a reply is received from the time server.
|
2001-01-17 18:26:21 +00:00
|
|
|
.Sh RETURN VALUES
|
|
|
|
.Rv -std rtime
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr timed 8
|