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