rpc/dateproc.c
/*
* dateproc.c - remote procedures; called by server stub.
*/
#include <rpc/rpc.h> /* standard RPC include file */
#include <time.h> /* for timing functions */
/*
* Return the binary date and time.
*/
long *
bin_date_1_svc(void)
{
static long timeval; /* must be static */
timeval = time((long *) 0);
return(&timeval);
}
/*
* Convert a binary time and return a human readable string.
*/
char **
str_date_1_svc(long *bintime)
{
static char *ptr; /* must be static */
ptr = ctime(bintime); /* convert to local time */
return(&ptr); /* return the address of pointer */
}