[lttng-dev] [Babeltrace RFC PATCH 19/28] Add MinGW implementation of posix_fallocate

Ikaheimonen, JP jp_ikaheimonen at mentor.com
Thu May 2 08:00:59 EDT 2013


Add dummy MinGW implementation of posix_fallocate.
The implementation does not do anything, and always returns zero.
---
 formats/ctf/ctf.c                 |  2 +-
 include/babeltrace/compat/fcntl.h | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 include/babeltrace/compat/fcntl.h

diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
index c29fcd7..431b2d4 100644
--- a/formats/ctf/ctf.c
+++ b/formats/ctf/ctf.c
@@ -41,7 +41,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
+#include <babeltrace/compat/fcntl.h>
 #include <dirent.h>
 #include <glib.h>
 #include <babeltrace/compat/unistd.h>
diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h
new file mode 100644
index 0000000..0707c28
--- /dev/null
+++ b/include/babeltrace/compat/fcntl.h
@@ -0,0 +1,13 @@
+#ifndef _BABELTRACE_INCLUDE_COMPAT_FCNTL_H
+#define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H
+
+#include <fcntl.h>
+#ifdef __MINGW32__
+static inline
+int posix_fallocate(int fd, off_t offset, off_t len)
+{
+	return 0;
+}
+#endif
+
+#endif
\ No newline at end of file
-- 
1.8.1.msysgit.1




More information about the lttng-dev mailing list