1 // utils.cpp : Defines the entry point for the DLL application.
4 #include "wvwin32-sanitize.h"
6 #define EPOCHFILETIME (116444736000000000LL)
8 int gettimeofday(struct timeval
*tv
, struct timezone
*tz
)
17 GetSystemTimeAsFileTime(&ft
);
18 li
.LowPart
= ft
.dwLowDateTime
;
19 li
.HighPart
= ft
.dwHighDateTime
;
20 t
= li
.QuadPart
; /* In 100-nanosecond intervals */
21 t
-= EPOCHFILETIME
; /* Offset to the Epoch time */
22 t
/= 10; /* In microseconds */
23 tv
->tv_sec
= (long)(t
/ 1000000);
24 tv
->tv_usec
= (long)(t
% 1000000);
35 tz
->tz_minuteswest
= _timezone
/ 60;
36 tz
->tz_dsttime
= _daylight
;
45 return GetCurrentThreadId();
49 unsigned int sleep(unsigned int secs
)
56 // FIXME: this makes alarms silently fail. They should probably fail more
57 // nicely, or (better still) actually work...
58 unsigned int alarm(unsigned int t
)
64 // This is the same as what Python uses, apparently