From d81f73fcb520cff58dcafda0e644b91837b26a40 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 14 Jul 2009 19:45:36 +0000 Subject: - Change mmap() to fail requests with EINVAL that pass a length of 0. This behavior is mandated by POSIX. - Do not fail requests that pass a length greater than SSIZE_MAX (such as > 2GB on 32-bit platforms). The 'len' parameter is actually an unsigned 'size_t' so negative values don't really make sense. Submitted by: Alexander Best alexbestms at math.uni-muenster.de Reviewed by: alc Approved by: re (kib) MFC after: 1 week --- lib/libc/sys/mmap.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index 196d6ae..91bf4e9 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd October 24, 2008 +.Dd July 14, 2009 .Dt MMAP 2 .Os .Sh NAME @@ -306,7 +306,7 @@ resides out of the valid address space for a user process. The .Fa len argument -was negative. +was equal to zero. .It Bq Er EINVAL .Dv MAP_ANON was specified and the -- cgit v1.1