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
|
|
|
.\"
|
1997-05-28 05:00:11 +00:00
|
|
|
.TH RTIME 3 "22 November 1987"
|
|
|
|
.SH NAME
|
|
|
|
rtime \- get remote time
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <sys/types.h>
|
|
|
|
.B #include <sys/time.h>
|
|
|
|
.B #include <netinet/in.h>
|
|
|
|
.LP
|
|
|
|
.B int rtime(addrp, timep, timeout)
|
|
|
|
.B struct sockaddr_in \(**addrp;
|
|
|
|
.B struct timeval \(**timep;
|
|
|
|
.B struct timeval \(**timeout;
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B rtime(\|)
|
|
|
|
consults the Internet Time Server at the address pointed to by
|
|
|
|
.I addrp
|
|
|
|
and returns the remote time in the
|
|
|
|
.B timeval
|
|
|
|
struct pointed to by
|
|
|
|
.IR timep .
|
|
|
|
Normally, the
|
|
|
|
.SM UDP
|
2000-03-02 09:14:21 +00:00
|
|
|
protocol is used when consulting the Time Server.
|
|
|
|
The
|
1997-05-28 05:00:11 +00:00
|
|
|
.I timeout
|
|
|
|
parameter specifies how long the
|
|
|
|
routine should wait before giving
|
|
|
|
up when waiting for a reply. If
|
|
|
|
.I timeout
|
|
|
|
is specified as
|
|
|
|
.SM NULL\s0,
|
|
|
|
however, the routine will instead use
|
|
|
|
.SM TCP
|
|
|
|
and block until a reply is received from the time server.
|
|
|
|
.LP
|
2000-03-02 09:14:21 +00:00
|
|
|
The routine returns 0 if it is successful.
|
|
|
|
Otherwise,
|
1997-05-28 05:00:11 +00:00
|
|
|
it returns \-1 and
|
|
|
|
.B errno
|
|
|
|
is set to reflect the cause of the error.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR timed (8c)
|