summaryrefslogtreecommitdiff
path: root/lib/gettimeofday.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gettimeofday.c')
-rw-r--r--lib/gettimeofday.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
new file mode 100644
index 000000000..fb31f12ef
--- /dev/null
+++ b/lib/gettimeofday.c
@@ -0,0 +1,20 @@
+/* replacement function of gettimeofday */
+
+#include "config.h"
+
+#include <sys/timeb.h>
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <sys/time.h>
+#endif
+
+int _xine_private_gettimeofday(struct timeval *tv) {
+ struct timeb tp;
+
+ ftime(&tp);
+ tv->tv_sec = tp.time;
+ tv->tv_usec = tp.millitm * 1000;
+
+ return 0;
+}