This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PCH support on Solaris


> In any case, I guess the current solution should work well enough for
> practical purposes; my only reason for speaking up in this thread
> was simply to point out that *if* you need to reimplement the Linux
> behaviour of mmap on Solaris, there is a way to do so in a 100%
> compatible manner using mincore checks followed by MAP_FIXED.  If
> this turns out to be not required, so much the better.

Do you mean that this code under Solaris

size = 1048576
guess = mmap (NULL, size, PROT_NONE,
    MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
munmap (guess, size);
addr = mmap (guess+4096, size-4096, PROT_NONE,
    MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
printf ("%x %x\n", guess, addr);

gives the same address for both guess and size?  That is, that Solaris completely
ignores the first argument unless MAP_FIXED is given?

If so, my idea is useless at least under Solaris.  But if not, I don't see your point.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]