[lttng-dev] [Babeltrace RFC PATCH 14/28] Add MinGW implementation of fpathconf
Ikaheimonen, JP
jp_ikaheimonen at mentor.com
Thu May 2 07:55:32 EDT 2013
The MinGW implementation of fpathconf will always return MAX_PATH.
---
formats/ctf/ctf.c | 2 +-
include/babeltrace/compat/unistd.h | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
create mode 100644 include/babeltrace/compat/unistd.h
diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
index 255a492..c29fcd7 100644
--- a/formats/ctf/ctf.c
+++ b/formats/ctf/ctf.c
@@ -44,7 +44,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <glib.h>
-#include <unistd.h>
+#include <babeltrace/compat/unistd.h>
#include <stdlib.h>
#include "metadata/ctf-scanner.h"
diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h
new file mode 100644
index 0000000..f275b22
--- /dev/null
+++ b/include/babeltrace/compat/unistd.h
@@ -0,0 +1,21 @@
+#ifndef _BABELTRACE_INCLUDE_COMPAT_UNISTD_H
+#define _BABELTRACE_INCLUDE_COMPAT_UNISTD_H
+
+#include <unistd.h>
+
+#ifndef _PC_NAME_MAX
+#define _PC_NAME_MAX 0
+#endif
+
+#ifdef __MINGW32__
+
+static inline
+int fpathconf (int fd, int name)
+{
+ /* dummy function that always returns MAX_PATH */
+ return MAX_PATH;
+}
+
+#endif
+
+#endif
\ No newline at end of file
--
1.8.1.msysgit.1
More information about the lttng-dev
mailing list