Util-Linux package development
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 07/15] include: provide MAP_ANONYMOUS on OSX
Date: Thu, 18 Feb 2016 15:10:19 +0100	[thread overview]
Message-ID: <201602181510.19403.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20160218132130.i3egpqw3lv7i653w@ws.net.home>

On Thursday 18 February 2016, Karel Zak wrote:
> On Thu, Feb 18, 2016 at 02:12:47PM +0100, Ruediger Meier wrote:
> > +#if defined __APPLE__
> > +# define _DARWIN_C_SOURCE
> > +#endif
> > +

This one is needed before including sys/mman.h. Don't know whether it 
would be better to define _DARWIN_C_SOURCE globally in compiler 
commandline (via configure for systems where it's needed)!?

> >  #include <stdio.h>
> >  #include <stdarg.h>
> >  #include <stdint.h>
> > @@ -62,6 +66,10 @@
> >  #define XALLOC_EXIT_CODE FSCK_EX_ERROR
> >  #include "xalloc.h"
> >
> > +#if !defined MAP_ANONYMOUS && defined MAP_ANON
> > +# define MAP_ANONYMOUS  (MAP_ANON)
> > +#endif
>
> What about to move this to include/c.h where we already have some
> portability ifdefs?

Would be nice to hide MAP_ANONYMOUS definition to include/c.h. But as 
long as _DARWIN_C_SOURCE will not be globally defined we would also 
need to include sys/mman.h there, right?

BTW here is how "dateutils" does it. Using a macro CHECK_MAP_ANON to get 
defines MAP_ANON_NEEDS_DARWIN_SOURCE and MAP_ANON_NEEDS_ALL_SOURCE
https://github.com/hroptatyr/dateutils/blob/master/m4/sxe-mmap.m4
https://github.com/hroptatyr/dateutils/blob/master/src/prchunk.c

cu,
Rudi

  reply	other threads:[~2016-02-18 14:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 13:12 [PATCH 00/15] portability fixes in the mix (OSX) Ruediger Meier
2016-02-18 13:12 ` [PATCH 01/15] travis: minor cleanup Ruediger Meier
2016-02-18 13:12 ` [PATCH 02/15] build-sys: portable usage of find command Ruediger Meier
2016-02-18 13:12 ` [PATCH 03/15] build-sys: check linker support for version scripts Ruediger Meier
2016-02-18 13:12 ` [PATCH 04/15] build-sys: fix [g]libtoolize version for OSX Ruediger Meier
2016-02-18 13:12 ` [PATCH 05/15] tests: fix ts_option helpers Ruediger Meier
2016-02-18 13:12 ` [PATCH 06/15] lib: rename strmode() and setmode() Ruediger Meier
2016-02-18 13:12 ` [PATCH 07/15] include: provide MAP_ANONYMOUS on OSX Ruediger Meier
2016-02-18 13:21   ` Karel Zak
2016-02-18 14:10     ` Ruediger Meier [this message]
2016-02-18 14:28       ` Karel Zak
2016-02-18 15:51   ` [PATCH v2 " Ruediger Meier
2016-02-18 13:12 ` [PATCH 08/15] lib: define LOGIN_NAME_MAX fallback Ruediger Meier
2016-02-18 13:12 ` [PATCH 09/15] include: check for sys/sysmacros.h Ruediger Meier
2016-02-18 13:22 ` [PATCH 10/15] include: remove unused mntent.h Ruediger Meier
2016-02-18 13:22 ` [PATCH 11/15] lsns: use xcalloc() Ruediger Meier
2016-02-18 13:22 ` [PATCH 12/15] lib: remove unused variable Ruediger Meier
2016-02-18 13:23 ` [PATCH 13/15] lib: fix ismounted includes for FreeBSD Ruediger Meier
2016-02-18 13:23 ` [PATCH 14/15] libblkid: don't include endian.h Ruediger Meier
2016-02-18 13:23 ` [PATCH 15/15] include: fix sys/sysinfo.h Ruediger Meier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201602181510.19403.sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox