[Python-Dev] Re: Almost insignificant patch for mmapmodule
Andrew Kuchling
akuchlin@mems-exchange.org
Sun, 18 Jun 2000 01:03:16 -0400
On Sat, Jun 17, 2000 at 04:29:14PM +0200, Lorenzo M. Catucci wrote:
>therefore, here is the change: if we are compiling for linux, define
>_GNU_SOURCE before including mman.h, and all is done. It seems the
Hmm... IMHO this points out a bug; if MREMAP_MAYMOVE is not present,
that doesn't imply that mremap() doesn't work at all; instead, a
resize may fail if the mapping would have to be moved to a different
virtual address. Quoting from the Linux man page:
MREMAP_MAYMOVE
indicates if the operation should fail, or change
the virtual address if the resize cannot be done at
the current virtual address.
I think the correct fix is to simply specify MREMAP_MAYMOVE if it's
defined, but still support attempting to resize. Possibly the
configure script should also check for mremap()'s existence.
--amk