#include <sys/mman.h>
#include <sys/uio.h>
#include <sys/resource.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/wait.h>
#include <setjmp.h>
#include "../os-windows.h"
#include "../../lib/hweight.h"
-extern unsigned long mtime_since_now(struct timeval *);
-extern void fio_gettime(struct timeval *, void *);
+extern unsigned long mtime_since_now(struct timespec *);
+extern void fio_gettime(struct timespec *, void *);
/* These aren't defined in the MinGW headers */
HRESULT WINAPI StringCchCopyA(
{
FILETIME utcFT;
LONGLONG jan1970;
+ SYSTEMTIME tempSystemTime;
jan1970 = Int32x32To64(dosTime, 10000000) + 116444736000000000;
utcFT.dwLowDateTime = (DWORD)jan1970;
utcFT.dwHighDateTime = jan1970 >> 32;
- FileTimeToSystemTime((FILETIME*)&utcFT, systemTime);
+ FileTimeToSystemTime((FILETIME*)&utcFT, &tempSystemTime);
+ SystemTimeToTzSpecificLocalTime(NULL, &tempSystemTime, systemTime);
}
char* ctime_r(const time_t *t, char *buf)
while (path[i] != '\\' && path[i] != '/' && i >= 0)
i--;
- strncpy(name, path + i + 1, MAX_PATH);
+ name[MAX_PATH - 1] = '\0';
+ strncpy(name, path + i + 1, MAX_PATH - 1);
return name;
}
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
{
- struct timeval tv;
+ struct timespec tv;
DWORD ms_remaining;
DWORD ms_total = (rqtp->tv_sec * 1000) + (rqtp->tv_nsec / 1000000.0);