xref: /csrg-svn/lib/libc/gen/time.c (revision 11305)
1*11305Ssam /*	time.c	4.2	83/02/27	*/
211249Ssam 
311249Ssam /*
411249Ssam  * Backwards compatible time call.
511249Ssam  */
611249Ssam #include <sys/types.h>
711249Ssam #include <sys/time.h>
811249Ssam 
911249Ssam time_t
1011249Ssam time(t)
1111249Ssam 	time_t *t;
1211249Ssam {
1311249Ssam 	struct timeval tt;
1411249Ssam 
15*11305Ssam 	if (gettimeofday(&tt, (struct timezone *)0) < 0)
1611249Ssam 		return (-1);
1711249Ssam 	if (t)
1811249Ssam 		*t = tt.tv_sec;
1911249Ssam 	return (tt.tv_sec);
2011249Ssam }
21