diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-06-07 23:09:47 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-06-07 23:09:47 +0000 |
commit | 29b3a6627e57585a156fb753c7781b4b1646a934 (patch) | |
tree | cb1c78bb8fdc8816d3c384a7c625653435f24946 /osdep.c | |
parent | 0fa7f157309dedfd715179241a70b43739a45fb1 (diff) | |
download | qemu-29b3a6627e57585a156fb753c7781b4b1646a934.zip qemu-29b3a6627e57585a156fb753c7781b4b1646a934.tar.gz qemu-29b3a6627e57585a156fb753c7781b4b1646a934.tar.bz2 |
Windows build fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2959 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'osdep.c')
-rw-r--r-- | osdep.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -264,3 +264,27 @@ int qemu_create_pidfile(const char *filename) #endif return 0; } + +#ifdef _WIN32 + +/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */ +#define _W32_FT_OFFSET (116444736000000000ULL) + +int qemu_gettimeofday(qemu_timeval *tp) +{ + union { + unsigned long long ns100; /*time since 1 Jan 1601 in 100ns units */ + FILETIME ft; + } _now; + + if(tp) + { + GetSystemTimeAsFileTime (&_now.ft); + tp->tv_usec=(long)((_now.ns100 / 10ULL) % 1000000ULL ); + tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000ULL); + } + /* Always return 0 as per Open Group Base Specifications Issue 6. + Do not set errno on error. */ + return 0; +} +#endif /* _WIN32 */ |