[lttng-dev] [PATCH babeltrace 2/3] Port: Add OSX mman.h compat

Jérémie Galarneau jeremie.galarneau at efficios.com
Thu Feb 11 14:17:35 EST 2016


Merged, thanks!

Jérémie

On Thu, Nov 5, 2015 at 12:51 PM, Michael Jeanson <mjeanson at efficios.com> wrote:
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
>  formats/lttng-live/lttng-live-comm.c |  2 +-
>  include/babeltrace/compat/mman.h     | 36 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 37 insertions(+), 1 deletion(-)
>  create mode 100644 include/babeltrace/compat/mman.h
>
> diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c
> index 0efae2d..c0a1868 100644
> --- a/formats/lttng-live/lttng-live-comm.c
> +++ b/formats/lttng-live/lttng-live-comm.c
> @@ -31,7 +31,6 @@
>  #include <errno.h>
>  #include <inttypes.h>
>  #include <fcntl.h>
> -#include <sys/mman.h>
>  #include <poll.h>
>
>  #include <babeltrace/ctf/ctf-index.h>
> @@ -53,6 +52,7 @@
>  #include <babeltrace/compat/memstream.h>
>  #include <babeltrace/compat/send.h>
>  #include <babeltrace/compat/string.h>
> +#include <babeltrace/compat/mman.h>
>
>  #include "lttng-live.h"
>  #include "lttng-viewer-abi.h"
> diff --git a/include/babeltrace/compat/mman.h b/include/babeltrace/compat/mman.h
> new file mode 100644
> index 0000000..061e244
> --- /dev/null
> +++ b/include/babeltrace/compat/mman.h
> @@ -0,0 +1,36 @@
> +#ifndef _BABELTRACE_COMPAT_MMAN_H
> +#define _BABELTRACE_COMPAT_MMAN_H
> +
> +/*
> + * babeltrace/compat/mman.h
> + *
> + * Copyright (C) 2015  Michael Jeanson <mjeanson at efficios.com>
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> + * SOFTWARE.
> + */
> +
> +#include <sys/mman.h>
> +
> +#ifndef MAP_ANONYMOUS
> +# ifdef MAP_ANON
> +#   define MAP_ANONYMOUS MAP_ANON
> +# endif
> +#endif
> +
> +#endif /* _BABELTRACE_COMPAT_MMAN_H */
> --
> 1.9.1
>



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



More information about the lttng-dev mailing list