RTIME(3N-BSD) RISC/os Reference Manual RTIME(3N-BSD)
NAME
rtime - get remote time
Headers
For -systype svr3:
#include <bsd/sys/types.h>
#include <bsd/sys/time.h>
#include <bsd/netinet/in.h>
For -systype bsd43:
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/in.h>
Declarations
int rtime(addrp, timep, timeout)
struct sockaddrin *addrp;
struct timeval *timep;
struct timeval *timeout;
DESCRIPTION
rtime() consults the Internet Time Server at the address
pointed to by addrp and returns the remote time in the
timeval struct pointed to by timep. Normally, the UDP pro-
tocol is used when consulting the Time Server. The timeout
parameter specifies how long the routine should wait before
giving up when waiting for a reply. If timeout is specified
as NULL, however, the routine will instead use TCP and block
until a reply is received from the time server.
The routine returns 0 if it is successful. Otherwise, it
returns -1 and errno is set to reflect the cause of the
error.
SEE ALSO
timed(8) in the System Administrator's Reference Manual.
ORIGIN
Sun Microsystems
NOTE
When these routines are used in a program which is compiled
in -systype svr3, they are not resolved by libc.a. See
intro(3) for more information.
Printed 11/19/92 Page 1