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 _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev