[lttng-dev] [Babeltrace PATCH 13/23] Add MinGW implementation of sleep
Ikaheimonen, JP
jp_ikaheimonen at mentor.com
Wed May 22 04:06:58 EDT 2013
Add new function sleep() that calls Windows Sleep() instead.
---
converter/babeltrace.c | 2 +-
include/babeltrace/compat/unistd.h | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/converter/babeltrace.c b/converter/babeltrace.c
index b356c43..5cc9949 100644
--- a/converter/babeltrace.c
+++ b/converter/babeltrace.c
@@ -46,7 +46,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <unistd.h>
+#include <babeltrace/compat/unistd.h>
#include <inttypes.h>
#include <babeltrace/compat/ftw.h>
#include <string.h>
diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h
index d39dd50..5a741a1 100644
--- a/include/babeltrace/compat/unistd.h
+++ b/include/babeltrace/compat/unistd.h
@@ -16,6 +16,11 @@ int fpathconf (int fd, int name)
return MAX_PATH;
}
-#endif
+static inline
+void sleep(unsigned int x)
+{
+ Sleep(1000 * x);
+}
#endif
+#endif
--
1.8.1.msysgit.1
More information about the lttng-dev
mailing list