bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Re: mmapping of /dev/zero always fails on darwin


From: Bruno Haible
Subject: Re: [bug-gnulib] Re: mmapping of /dev/zero always fails on darwin
Date: Tue, 13 Sep 2005 14:57:08 +0200
User-agent: KMail/1.5

Peter O'Gorman wrote:
> Just doing the same thing as gnulib does will show the failure:
>
> int main(){
>          void * address = NULL;
>          static int fd =-1;
>          int ret = 0;
>          fd = open ("/dev/zero",O_RDONLY,666);
>          ret = mmap (NULL, 4096, PROT_READ | PROT_WRITE, MAP_FILE | 
> MAP_PRIVATE, fd, 0);
>          if (ret != MAP_FAILED) return 0;
> return 1;
> }

Are you sure that this is what gnulib does? Darwin's <sys/mman.h> defines
MAP_ANON, then gnulib's m4/mmap-anon.m4 macro ought to add
  #define MAP_ANONYMOUS MAP_ANON
  #define HAVE_MAP_ANONYMOUS 1
to config.h, and then lib/pagealign_alloc.c should be doing

  mmap (NULL, 4096, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);

Is pagealign_alloc.c doing this or not?

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]