[PATCH 2.6] fix mmap() return value to conform to POSIX

From: Hong Liu
Date: Mon Mar 21 2005 - 05:35:33 EST


POSIX said:
mmap() should return [EOVERFLOW] if the file is a regular file and the
value of off + len exceeds the offset maximum established in the open
file description associated with fildes.

--- a/mm/mmap.c.orig 2005-03-16 14:08:59.116052416 +0800
+++ b/mm/mmap.c 2005-03-16 14:10:16.167338840 +0800
@@ -906,7 +906,7 @@ unsigned long do_mmap_pgoff(struct file

/* offset overflow? */
if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
- return -EINVAL;
+ return -EOVERFLOW;

/* Too many mappings? */
if (mm->map_count > sysctl_max_map_count)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/