NetBSD/gnu/libexec/uucp/libunix/time.c

35 lines
663 B
C
Raw Normal View History

1993-08-04 23:30:29 +04:00
/* time.c
Get the current time. */
#include "uucp.h"
#if HAVE_TIME_H
#include <time.h>
#endif
#include "system.h"
1998-02-04 17:32:51 +03:00
#ifndef POSIX_HEADERS
1993-08-04 23:30:29 +04:00
#ifndef time
extern time_t time ();
#endif
1998-02-04 17:32:51 +03:00
#endif
1993-08-04 23:30:29 +04:00
/* Get the time in seconds since the epoch, with optional
microseconds. We use ixsysdep_process_time to get the microseconds
if it will work (it won't if it uses times, since that returns a
time based only on the process). */
long
ixsysdep_time (pimicros)
long *pimicros;
{
#if HAVE_GETTIMEOFDAY || HAVE_FTIME
return ixsysdep_process_time (pimicros);
#else
if (pimicros != NULL)
*pimicros = 0;
return (long) time ((time_t *) NULL);
#endif
}