1.\" @(#)rtime.3n 2.1 88/08/08 4.0 RPCSRC; from 1.5 88/02/08 SMI 2.\" 3.Dd May 13, 2021 4.Dt RTIME 3 5.Os 6.Sh NAME 7.Nm rtime 8.Nd "get remote time" 9.Sh LIBRARY 10.Lb libc 11.Sh SYNOPSIS 12.In sys/types.h 13.In sys/time.h 14.In netinet/in.h 15.Ft int 16.Fo rtime 17.Fa "struct sockaddr_in *addrp" 18.Fa "struct timeval *timep" 19.Fa "struct timeval *timeout" 20.Fc 21.Sh DESCRIPTION 22The 23.Fn rtime 24function 25consults the Internet Time Server at the address pointed to by 26.Fa addrp 27and returns the remote time in the 28.Vt timeval 29struct pointed to by 30.Fa timep . 31Normally, the 32.Tn UDP 33protocol is used when consulting the Time Server. 34The 35.Fa timeout 36argument specifies how long the 37routine should wait before giving 38up when waiting for a reply. 39If 40.Fa timeout 41is specified as 42.Dv NULL , 43however, the routine will instead use 44.Tn TCP 45and block until a reply is received from the time server. 46.Sh RETURN VALUES 47.Rv -std rtime 48