Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Jul 2009 00:48:45 +0200 (CEST)
From:      Alexander Best <alexbestms@math.uni-muenster.de>
To:        <freebsd-hackers@FreeBSD.org>
Subject:   mmap/munmap with zero length
Message-ID:  <permail-20090704224845f0889e84000046f1-a_best01@message-id.uni-muenster.de>

next in thread | raw e-mail | index | archive | help
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.

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?

cheers.
alex



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20090704224845f0889e84000046f1-a_best01>