1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright (c) 1997-2000 by Sun Microsystems, Inc.
3*0Sstevel@tonic-gate  * All rights reserved.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate #ifndef LINT
7*0Sstevel@tonic-gate static const char rcsid[] = "$Id: gettimeofday.c,v 8.4 1999/10/13 16:39:21 vixie Exp $";
8*0Sstevel@tonic-gate #endif
9*0Sstevel@tonic-gate 
10*0Sstevel@tonic-gate 
11*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
12*0Sstevel@tonic-gate 
13*0Sstevel@tonic-gate #include "port_before.h"
14*0Sstevel@tonic-gate #include "port_after.h"
15*0Sstevel@tonic-gate 
16*0Sstevel@tonic-gate #if !defined(NEED_GETTIMEOFDAY)
17*0Sstevel@tonic-gate int __bindcompat_gettimeofday;
18*0Sstevel@tonic-gate #else
19*0Sstevel@tonic-gate int
20*0Sstevel@tonic-gate gettimeofday(struct timeval *tvp, struct _TIMEZONE *tzp) {
21*0Sstevel@tonic-gate 	time_t clock, time(time_t *);
22*0Sstevel@tonic-gate 
23*0Sstevel@tonic-gate 	if (time(&clock) == (time_t) -1)
24*0Sstevel@tonic-gate 		return (-1);
25*0Sstevel@tonic-gate 	if (tvp) {
26*0Sstevel@tonic-gate 		tvp->tv_sec = clock;
27*0Sstevel@tonic-gate 		tvp->tv_usec = 0;
28*0Sstevel@tonic-gate 	}
29*0Sstevel@tonic-gate 	if (tzp) {
30*0Sstevel@tonic-gate 		tzp->tz_minuteswest = 0;
31*0Sstevel@tonic-gate 		tzp->tz_dsttime = 0;
32*0Sstevel@tonic-gate 	}
33*0Sstevel@tonic-gate 	return (0);
34*0Sstevel@tonic-gate }
35*0Sstevel@tonic-gate #endif /*NEED_GETTIMEOFDAY*/
36