1 #include <msvcrt/alloc.h>
2 #include <msvcrt/stdlib.h>
3 #include <msvcrt/sys/utime.h>
5 #include <msvcrt/time.h>
6 #include <msvcrt/errno.h>
7 #include <msvcrt/internal/file.h>
13 int _futime(int nHandle, struct _utimbuf* pTimes)
15 FILETIME LastAccessTime;
16 FILETIME LastWriteTime;
18 // check for stdin / stdout handles ??
25 pTimes = alloca(sizeof(struct _utimbuf));
26 time(&pTimes->actime);
27 time(&pTimes->modtime);
30 if (pTimes->actime < pTimes->modtime) {
35 UnixTimeToFileTime(pTimes->actime, &LastAccessTime, 0);
36 UnixTimeToFileTime(pTimes->modtime, &LastWriteTime, 0);
37 if (!SetFileTime(_get_osfhandle(nHandle), NULL, &LastAccessTime, &LastWriteTime)) {