1 #include <crtdll/alloc.h>
2 #include <crtdll/stdlib.h>
3 #include <crtdll/sys/utime.h>
5 #include <crtdll/time.h>
6 #include <crtdll/errno.h>
7 #include <crtdll/internal/file.h>
9 int _futime (int nHandle, struct _utimbuf *pTimes)
11 FILETIME LastAccessTime;
12 FILETIME LastWriteTime;
14 // check for stdin / stdout handles ??
15 if ( nHandle == -1 ) {
20 if ( pTimes == NULL ) {
21 pTimes = alloca(sizeof(struct _utimbuf));
22 time(&pTimes->actime);
23 time(&pTimes->modtime);
26 if ( pTimes->actime < pTimes->modtime ) {
31 UnixTimeToFileTime(pTimes->actime,&LastAccessTime,0);
32 UnixTimeToFileTime(pTimes->modtime,&LastWriteTime,0);
33 if ( !SetFileTime(_get_osfhandle(nHandle),NULL, &LastAccessTime, &LastWriteTime) ) {