mmap/munmap with zero length

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <freebsd-hackers@...>
Date: Saturday, July 4, 2009 - 6:48 pm

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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
mmap/munmap with zero length, Alexander Best, (Sat Jul 4, 6:48 pm)
Re: mmap/munmap with zero length, Nate Eldredge, (Sat Jul 4, 8:40 pm)
Re: mmap/munmap with zero length, Alexander Best, (Sun Jul 5, 3:32 am)
Re: mmap/munmap with zero length, John Baldwin, (Mon Jul 13, 2:28 pm)
Re: mmap/munmap with zero length, Tijl Coosemans, (Mon Jul 13, 3:33 pm)
Re: mmap/munmap with zero length, John Baldwin, (Mon Jul 13, 4:39 pm)
Re: mmap/munmap with zero length, Mel Flynn, (Mon Jul 20, 2:13 am)
Re: mmap/munmap with zero length, Mel Flynn, (Mon Jul 20, 3:07 am)
Re: mmap/munmap with zero length, Alan Cox, (Tue Jul 14, 12:32 pm)
Re: mmap/munmap with zero length, Paul B. Mahol, (Sat Jul 4, 8:27 pm)
Re: mmap/munmap with zero length, Dag-Erling Smørgrav, (Mon Jul 6, 8:14 am)
Re: mmap/munmap with zero length, Bob Bishop, (Mon Jul 6, 9:05 am)
Re: mmap/munmap with zero length, Alexander Best, (Wed Jul 8, 6:42 pm)
Re: mmap/munmap with zero length, Dag-Erling Smørgrav, (Mon Jul 6, 9:49 am)