diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
| commit | a16f65c7d117419bd266c28a1901ef129a337569 (patch) | |
| tree | 2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /gnu/libexec/uucp/libunix/time.c | |
| parent | 8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff) | |
Diffstat (limited to 'gnu/libexec/uucp/libunix/time.c')
| -rw-r--r-- | gnu/libexec/uucp/libunix/time.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/libexec/uucp/libunix/time.c b/gnu/libexec/uucp/libunix/time.c new file mode 100644 index 000000000000..d0462433a7dd --- /dev/null +++ b/gnu/libexec/uucp/libunix/time.c @@ -0,0 +1,32 @@ +/* time.c + Get the current time. */ + +#include "uucp.h" + +#if HAVE_TIME_H +#include <time.h> +#endif + +#include "system.h" + +#ifndef time +extern time_t time (); +#endif + +/* 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 +} |
