From b6f7c57ecf2fcefa805b1cebb1751d5fecd1ddfe Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Sun, 18 Apr 2004 23:36:45 +0000 Subject: Document POSIX stupidity: Attempts to mmap zero bytes will succeed (and have no effect), while attempts to munmap zero bytes will fail. --- lib/libc/sys/mmap.2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index f7fd62dd4efd..8d6cfd76dfe7 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -363,3 +363,10 @@ the file system code that causes the limit to be further restricted to .Pp Another reason for the 2GB limit is that file system metadata can reside at negative offsets. +.Pp +Note that an attempt to +.Fn mmap +zero bytes has no effect and succeeds, while an attempt to +.Fn munmap +zero bytes will return +.Bq Er EINVAL . -- cgit v1.3