4.104.114.84.95
Line | |
---|
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.4 2000/03/02 09:13:48 sheldonh Exp $ |
---|
3 | .\" |
---|
4 | .TH RTIME 3 "22 November 1987" |
---|
5 | .SH NAME |
---|
6 | rtime \- get remote time |
---|
7 | .SH SYNOPSIS |
---|
8 | .nf |
---|
9 | .B #include <sys/types.h> |
---|
10 | .B #include <sys/time.h> |
---|
11 | .B #include <netinet/in.h> |
---|
12 | .LP |
---|
13 | .B int rtime(addrp, timep, timeout) |
---|
14 | .B struct sockaddr_in \(**addrp; |
---|
15 | .B struct timeval \(**timep; |
---|
16 | .B struct timeval \(**timeout; |
---|
17 | .fi |
---|
18 | .SH DESCRIPTION |
---|
19 | .B rtime(\|) |
---|
20 | consults the Internet Time Server at the address pointed to by |
---|
21 | .I addrp |
---|
22 | and returns the remote time in the |
---|
23 | .B timeval |
---|
24 | struct pointed to by |
---|
25 | .IR timep . |
---|
26 | Normally, the |
---|
27 | .SM UDP |
---|
28 | protocol is used when consulting the Time Server. |
---|
29 | The |
---|
30 | .I timeout |
---|
31 | parameter specifies how long the |
---|
32 | routine should wait before giving |
---|
33 | up when waiting for a reply. If |
---|
34 | .I timeout |
---|
35 | is specified as |
---|
36 | .SM NULL\s0, |
---|
37 | however, the routine will instead use |
---|
38 | .SM TCP |
---|
39 | and block until a reply is received from the time server. |
---|
40 | .LP |
---|
41 | The routine returns 0 if it is successful. |
---|
42 | Otherwise, |
---|
43 | it returns \-1 and |
---|
44 | .B errno |
---|
45 | is set to reflect the cause of the error. |
---|
46 | .SH "SEE ALSO" |
---|
47 | .BR timed (8c) |
---|
Note: See
TracBrowser
for help on using the repository browser.