# rtime(3t) - man - phpMan

[RTIME(3)](https://www.chedong.com/phpMan.php/man/RTIME/3/markdown)                 BSD Library Functions Manual                 [RTIME(3)](https://www.chedong.com/phpMan.php/man/RTIME/3/markdown)

## NAME
     **rtime** — get remote time

## SYNOPSIS
### #include <sys/types.h>
### #include <sys/time.h>
### #include <netinet/in.h>

     _int_
     **rtime**(_struct_ _sockaddr_in_ _*addrp_, _struct_ _timeval_ _*timep_, _struct_ _timeval_ _*timeout_);

## DESCRIPTION
     The **rtime**() function 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 protocol
     is used when consulting the Time Server.  The _timeout_ argument specifies how long the routine
     should wait before giving up when waiting for a reply.  If _timeout_ is specified as NULL, how‐
     ever, the routine will instead use TCP and block until a reply is received from the time
     server.

## RETURN VALUES
     The **rtime**() function returns the value 0 if successful; otherwise the value -1 is returned and
     the global variable _errno_ is set to indicate the error.

## AVAILABILITY
     The **rtime**() function is part of libtirpc.

BSD                            November 22, 1987                           BSD
