diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 86dc75861..5e9c71226 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1008,6 +1008,29 @@ int clock_gettime(clockid_t clockid, struct timespec *tp) | |||
1008 | return 0; | 1008 | return 0; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | int clock_settime(clockid_t clockid, const struct timespec *tp) | ||
1012 | { | ||
1013 | SYSTEMTIME st; | ||
1014 | FILETIME ft; | ||
1015 | |||
1016 | if (clockid != CLOCK_REALTIME) { | ||
1017 | errno = ENOSYS; | ||
1018 | return -1; | ||
1019 | } | ||
1020 | |||
1021 | timespec_to_filetime(*tp, &ft); | ||
1022 | if (FileTimeToSystemTime(&ft, &st) == 0) { | ||
1023 | errno = EINVAL; | ||
1024 | return -1; | ||
1025 | } | ||
1026 | |||
1027 | if (SetSystemTime(&st) == 0) { | ||
1028 | errno = EPERM; | ||
1029 | return -1; | ||
1030 | } | ||
1031 | return 0; | ||
1032 | } | ||
1033 | |||
1011 | int pipe(int filedes[2]) | 1034 | int pipe(int filedes[2]) |
1012 | { | 1035 | { |
1013 | if (_pipe(filedes, PIPE_BUF, 0) < 0) | 1036 | if (_pipe(filedes, PIPE_BUF, 0) < 0) |