Use free Windows DDK and compile with latest MinGW releases.
[reactos.git] / reactos / lib / msvcrt / io / utime.c
1 #include <msvcrti.h>
2
3
4 int _utime(const char* filename, struct _utimbuf* buf)
5 {
6 int fn;
7 int ret;
8
9 fn = _open(filename, _O_RDWR);
10 if (fn == -1)
11 {
12 __set_errno(EBADF);
13 return -1;
14 }
15 ret = _futime(fn,buf);
16 if (_close(fn) < 0)
17 return -1;
18 return ret;
19 }
20
21 int _wutime(const wchar_t* filename, struct _utimbuf* buf)
22 {
23 int fn;
24 int ret;
25
26 fn = _wopen(filename, _O_RDWR);
27 if (fn == -1)
28 {
29 __set_errno(EBADF);
30 return -1;
31 }
32 ret = _futime(fn,buf);
33 if (_close(fn) < 0)
34 return -1;
35 return ret;
36 }