2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 POSIX.1-2008 utimes() function
15 /*****************************************************************************
24 const struct timeval tvp
[2])
27 Change last access and last modification time of the given file to
28 times specified in tvp array. If tvp is NULL, the current time will be
32 filename - Name of the file
33 buf - Pointer to an array of two timeval structures. First structure
34 specifies the last access time, second specifies the last
38 0 on success and -1 on error. If an error occurred, the global
39 variable errno is set.
42 The timeval structure has microsecond resolution, but in reality
43 this function has time resolution of 1 tick.
48 Since AROS has no notion of last access time, it's silently ignored
49 and only modification time of the file is set.
56 ******************************************************************************/
60 if (!file
) /*safety check */
66 file
= __path_u2a(file
);
72 ULONG t
= (ULONG
)tvp
[1].tv_sec
- 2922 * 1440 * 60;
74 ds
.ds_Days
= t
/ (60*60*24);
75 ds
.ds_Minute
= (t
/ 60) % (60*24);
76 ds
.ds_Tick
= (t
% 60) * TICKS_PER_SECOND
;
81 if (SetFileDate(file
, &ds
))
84 errno
= __stdc_ioerr2errno(IoErr());