xref: /csrg-svn/lib/libc/gen/utime.c (revision 45653)
1*45653Sbostic /*-
2*45653Sbostic  * Copyright (c) 1990 The Regents of the University of California.
3*45653Sbostic  * All rights reserved.
4*45653Sbostic  *
5*45653Sbostic  * %sccs.include.redist.c%
621335Sdist  */
712844Ssam 
826522Sdonn #if defined(LIBC_SCCS) && !defined(lint)
9*45653Sbostic static char sccsid[] = "@(#)utime.c	5.3 (Berkeley) 11/28/90";
10*45653Sbostic #endif /* LIBC_SCCS and not lint */
1121335Sdist 
1212845Ssam #include <sys/time.h>
13*45653Sbostic #include <utime.h>
1412844Ssam 
15*45653Sbostic utime(path, times)
16*45653Sbostic 	char *path;
17*45653Sbostic 	struct utimbuf *times;
1812844Ssam {
1912844Ssam 	struct timeval tv[2];
2012844Ssam 
21*45653Sbostic 	tv[0].tv_sec = times->actime;
22*45653Sbostic 	tv[1].tv_sec = times->modtime;
23*45653Sbostic 	tv[0].tv_usec = tv[1].tv_usec = 0;
24*45653Sbostic 	return(utimes(path, tv));
2512844Ssam }
26