ack/lang/cem/libcc.ansi/time/time.c

25 lines
367 B
C
Raw Normal View History

1989-06-12 15:22:14 +00:00
/*
* time - return the current calendar time (seconds since jan 1, 1970)
*/
1994-06-24 14:02:31 +00:00
/* $Id$ */
1989-06-12 15:22:14 +00:00
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <ack/config.h>
1989-12-18 15:33:48 +00:00
#ifndef ACKCONF_TIME_IS_A_SYSCALL
1989-06-12 15:22:14 +00:00
time_t
time(time_t *timer)
{
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
1989-06-12 15:22:14 +00:00
if (timer) *timer = tv.tv_sec;
return tv.tv_sec;
}
1989-12-18 15:33:48 +00:00
#endif