Gets remote time.
C Library (libc.a)
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.
Item | Description |
---|---|
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.