1*21364Sdist /* 2*21364Sdist * Copyright (c) 1980 Regents of the University of California. 3*21364Sdist * All rights reserved. The Berkeley software License Agreement 4*21364Sdist * specifies the terms and conditions for redistribution. 5*21364Sdist */ 611249Ssam 7*21364Sdist #ifndef lint 8*21364Sdist static char sccsid[] = "@(#)time.c 5.1 (Berkeley) 05/30/85"; 9*21364Sdist #endif not lint 10*21364Sdist 1111249Ssam /* 1211249Ssam * Backwards compatible time call. 1311249Ssam */ 1411249Ssam #include <sys/types.h> 1511249Ssam #include <sys/time.h> 1611249Ssam 1711249Ssam time_t 1811249Ssam time(t) 1911249Ssam time_t *t; 2011249Ssam { 2111249Ssam struct timeval tt; 2211249Ssam 2311305Ssam if (gettimeofday(&tt, (struct timezone *)0) < 0) 2411249Ssam return (-1); 2511249Ssam if (t) 2611249Ssam *t = tt.tv_sec; 2711249Ssam return (tt.tv_sec); 2811249Ssam } 29