summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb5799d)
raw | patch | inline | side by side (parent: bb5799d)
author | Johannes Sixt <johannes.sixt@telecom.at> | |
Sat, 1 Dec 2007 20:51:20 +0000 (21:51 +0100) | ||
committer | Johannes Sixt <johannes.sixt@telecom.at> | |
Mon, 23 Jun 2008 11:40:29 +0000 (13:40 +0200) |
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
compat/mingw.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index c6a5c1b2184643a84ac2fc9dde619f89f245386a..57af486b7a456e404b60352dc9abffa5b1a47a5d 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
int gettimeofday(struct timeval *tv, void *tz)
{
- return -1;
+ SYSTEMTIME st;
+ struct tm tm;
+ GetSystemTime(&st);
+ tm.tm_year = st.wYear-1900;
+ tm.tm_mon = st.wMonth-1;
+ tm.tm_mday = st.wDay;
+ tm.tm_hour = st.wHour;
+ tm.tm_min = st.wMinute;
+ tm.tm_sec = st.wSecond;
+ tv->tv_sec = tm_to_time_t(&tm);
+ if (tv->tv_sec < 0)
+ return -1;
+ tv->tv_usec = st.wMilliseconds*1000;
+ return 0;
}
int poll(struct pollfd *ufds, unsigned int nfds, int timeout)