[lttng-dev] [Babeltrace RFC PATCH 14/28] Add MinGW implementation of fpathconf

Jérémie Galarneau jeremie.galarneau at efficios.com
Mon May 13 16:20:47 EDT 2013


On Thu, May 2, 2013 at 7:55 AM, Ikaheimonen, JP
<jp_ikaheimonen at mentor.com> wrote:
> 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

^
This file is missing a new-line character at the end.

> --
> 1.8.1.msysgit.1
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list