Date: Sun, 5 Jul 2009 00:27:48 +0000 From: "Paul B. Mahol" <onemda@gmail.com> To: Alexander Best <alexbestms@math.uni-muenster.de> Cc: freebsd-hackers@freebsd.org Subject: Re: mmap/munmap with zero length Message-ID: <3a142e750907041727l6fac4b67m33973ec352664c6b@mail.gmail.com> In-Reply-To: <permail-20090704224845f0889e84000046f1-a_best01@message-id.uni-muenster.de> References: <permail-20090704224845f0889e84000046f1-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 7/4/09, Alexander Best <alexbestms@math.uni-muenster.de> wrote: > i'm wondering why mmap and munmap behave differently when it comes to a > length > argument of zero. allocating memory with mmap for a zero length file returns > a > valid pointer to the mapped region. there is V flag for malloc.conf > > munmap however isn't able to remove a mapping with no length. > > wouldn't it be better to either forbid this in mmap or to allow it in > munmap? It wouldn't improve badly written program. -- Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a142e750907041727l6fac4b67m33973ec352664c6b>