freebsd-skq/lib/libc/rpc/rtime.3

49 lines
922 B
Groff
Raw Normal View History

.\" @(#)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$
.\"
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
.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
consults the Internet Time Server at the address pointed to by
2001-01-17 18:26:21 +00:00
.Fa addrp
and returns the remote time in the
2001-01-17 18:26:21 +00:00
.Vt timeval
struct pointed to by
2001-01-17 18:26:21 +00:00
.Fa timep .
Normally, the
2001-01-17 18:26:21 +00:00
.Tn UDP
protocol is used when consulting the Time Server.
The
2001-01-17 18:26:21 +00:00
.Fa timeout
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
is specified as
2001-01-17 18:26:21 +00:00
.Dv NULL ,
however, the routine will instead use
2001-01-17 18:26:21 +00:00
.Tn TCP
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