Go to main content

ONC+ RPC Developer's Guide

Exit Print View

Updated: March 2019
 
 

Time Server Program (rpcgen)

Example 102  rpcgen Program: time.x
/*
 * time.x: Remote time protocol
 */
program TIMEPROG {
 	version TIMEVERS {
 			unsigned int TIMEGET(void) = 1;
 	} = 1;
} = 0x20000044;

#ifdef RPC_SVC
%int *
%timeget_1()
%{
%	static int thetime;
%
%	thetime = time(0);
%	return (&thetime);
%}
#endif