source: rtems/cpukit/libcsupport/src/utimes.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 729 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Change File Last Access and Modification Times
5 *  @ingroup libcsupport
6 */
7
8/*
9 *  Written by: Vinu Rajashekhar <vinutheraj@gmail.com>
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <sys/types.h>
21#include <utime.h>
22#include <sys/time.h>
23
24int utimes(
25  const char           *path,
26  const struct timeval  times[2]
27)
28{
29  struct utimbuf timeinsecs;
30
31  if ( times == NULL )
32    return utime( path, NULL );
33
34  timeinsecs.actime  = times[0].tv_sec;
35  timeinsecs.modtime = times[1].tv_sec;
36
37  return utime( path, &timeinsecs );
38}
Note: See TracBrowser for help on using the repository browser.