2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
13 /*****************************************************************************
22 const struct timeval tvp
[2])
25 Change last access and last modification time of the given file to
26 times specified in tvp array. If tvp is NULL, the current time will be
30 filename - Name of the file
31 buf - Pointer to an array of two timeval structures. First structure
32 specifies the last access time, second specifies the last
36 0 on success and -1 on error. If an error occurred, the global
37 variable errno is set.
40 The timeval structure has microsecond resolution, but in reality
41 this function has time resolution of 1 tick.
46 Since AROS has no notion of last access time, it's silently ignored
47 and only modification time of the file is set.
54 ******************************************************************************/
58 if (!file
) /*safety check */
64 file
= __path_u2a(file
);
70 ULONG t
= (ULONG
)tvp
[1].tv_sec
- 2922 * 1440 * 60;
72 ds
.ds_Days
= t
/ (60*60*24);
73 ds
.ds_Minute
= (t
/ 60) % (60*24);
74 ds
.ds_Tick
= (t
% 60) * TICKS_PER_SECOND
;
79 if (SetFileDate(file
, &ds
))
82 errno
= __arosc_ioerr2errno(IoErr());