Gets remote time.
C Library (libc.a)
#include <rpc/rpc.h> #include <sys/types.h> #include <sys/time.h> #include <netinet/in.h>
int rtime (addrp, timep, timeout) struct sockaddr_in *addrp; struct timeval *timep; struct timeval *timeout;
The rtime subroutine consults the Internet Time Server (TIME) at the address pointed to by the addrp parameter and returns the remote time in the timeval structure pointed to by the timep parameter. Normally, the User Datagram Protocol (UDP) protocol is used when consulting the time server. If the timeout parameter is specified as null, however, the routine instead uses Transmission Control Protocol (TCP) and blocks until a reply is received from the time server.
|addrp||Points to the Internet Time Server.|
|timep||Points to the timeval structure.|
|timeout||Specifies how long the routine waits for a reply before terminating.|
Upon successful completion, this subroutine returns a value of 0. If unsuccessful, it returns a value of -1, and the errno global variable is set to reflect the cause of the error.
This subroutine is part of Base Operating System (BOS) Runtime.
List of RPC Programming References.
TCP/IP Protocols in AIX Version 4.3 System Management Guide: Communications and Networks.
Remote Procedure Call (RPC) Overview for Programming in AIX Version 4.3 Communications Programming Concepts.