src/timer.c
/************************************************************************/
/*									*/
/*			s u b r _ s e t t i m e				*/
/*									*/
/*	Converts its argument, a time in ALTO seconds, to the		*/
/*	UNIX time format, and sets the UNIX clock.  You must be		*/
/*	the super-user for this to work.				*/
/*									*/
/*	Implements the SETTIME subr call, sub-dispatched from subr.c	*/
/*									*/
/************************************************************************/
s u b r _ s e t t i m e

Converts its argument, a time in ALTO seconds, to the
UNIX time format, and sets the UNIX clock.  You must be
the super-user for this to work.

Implements the SETTIME subr call, sub-dispatched from subr.c
s u b r _ s e t t i m e Converts its argument a time in ALTO seconds to the UNIX time format and sets the UNIX clock . You must be the super - user for this to work . Implements the SETTIME subr call sub - dispatched from subr . c
void subr_settime(LispPTR args[])
{
#ifdef DOS
  struct dostime_t dostime;
  struct dosdate_t dosday;
  struct tm uxtime;
  uxtime = *localtime((time_t *)(*((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF));
  dostime.hsecond = 0;
  dostime.second = uxtime.tm_sec;
  dostime.minute = uxtime.tm_min;
  dostime.hour = uxtime.tm_hour;
  _dos_settime(&dostime);
  dosday.day = uxtime.tm_mday;
  dosday.month = uxtime.tm_mon;
  dosday.year = uxtime.tm_year;
  dosday.dayofweek = uxtime.tm_wday;
  _dos_setdate(&dosday);
#else
  struct timeval timev;
  timev.tv_sec = *((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF;
  timev.tv_usec = 0;
  settimeofday(&timev, NULL);
#endif
}
void subr_settime ( LispPTR args [ ] ) { #ifdef DOS struct dostime_t dostime ; struct dosdate_t dosday ; struct tm uxtime ; uxtime = * localtime ( ( time_t * ) ( * ( ( int * ) Addr68k_from_LADDR ( args [ 0 ] ) ) - UNIX_ALTO_TIME_DIFF ) ) ; dostime . hsecond = 0 ; dostime . second = uxtime . tm_sec ; dostime . minute = uxtime . tm_min ; dostime . hour = uxtime . tm_hour ; _dos_settime ( & dostime ) ; dosday . day = uxtime . tm_mday ; dosday . month = uxtime . tm_mon ; dosday . year = uxtime . tm_year ; dosday . dayofweek = uxtime . tm_wday ; _dos_setdate ( & dosday ) ; #else struct timeval timev ; timev . tv_sec = * ( ( int * ) Addr68k_from_LADDR ( args [ 0 ] ) ) - UNIX_ALTO_TIME_DIFF ; timev . tv_usec = 0 ; settimeofday ( & timev , NULL ) ; #endif }
s u b r _ s e t t i m e
s u b r _ s e t t i m e