[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 1


rtime Subroutine

Purpose

Gets remote time.

Library

C Library (libc.a)

Syntax

#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;

Description

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.

Parameters


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.

Return Values

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.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

List of RPC Programming References.

TCP/IP Protocols in AIX 5L Version 5.1 System Management Guide: Communications and Networks.

Remote Procedure Call (RPC) Overview for Programming in AIX 5L Version 5.1 Communications Programming Concepts.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]