summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv2/common/bsd/gettimeofday.c
diff options
context:
space:
mode:
authorstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
committerstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
commit7c478bd95313f5f23a4c958a745db2134aa03244 (patch)
treec871e58545497667cbb4b0a4f2daf204743e1fe7 /usr/src/lib/libresolv2/common/bsd/gettimeofday.c
downloadillumos-gate-7c478bd95313f5f23a4c958a745db2134aa03244.tar.gz
OpenSolaris Launch
Diffstat (limited to 'usr/src/lib/libresolv2/common/bsd/gettimeofday.c')
-rw-r--r--usr/src/lib/libresolv2/common/bsd/gettimeofday.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/usr/src/lib/libresolv2/common/bsd/gettimeofday.c b/usr/src/lib/libresolv2/common/bsd/gettimeofday.c
new file mode 100644
index 0000000000..68b5ca39a0
--- /dev/null
+++ b/usr/src/lib/libresolv2/common/bsd/gettimeofday.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 1997-2000 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+#ifndef LINT
+static const char rcsid[] = "$Id: gettimeofday.c,v 8.4 1999/10/13 16:39:21 vixie Exp $";
+#endif
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include "port_before.h"
+#include "port_after.h"
+
+#if !defined(NEED_GETTIMEOFDAY)
+int __bindcompat_gettimeofday;
+#else
+int
+gettimeofday(struct timeval *tvp, struct _TIMEZONE *tzp) {
+ time_t clock, time(time_t *);
+
+ if (time(&clock) == (time_t) -1)
+ return (-1);
+ if (tvp) {
+ tvp->tv_sec = clock;
+ tvp->tv_usec = 0;
+ }
+ if (tzp) {
+ tzp->tz_minuteswest = 0;
+ tzp->tz_dsttime = 0;
+ }
+ return (0);
+}
+#endif /*NEED_GETTIMEOFDAY*/