From: Hong Liu 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. Signed-off-by: Andrew Morton --- 25-akpm/mm/mmap.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN mm/mmap.c~fix-mmap-return-value-to-conform-to-posix mm/mmap.c --- 25/mm/mmap.c~fix-mmap-return-value-to-conform-to-posix 2005-03-21 21:15:47.000000000 -0800 +++ 25-akpm/mm/mmap.c 2005-03-21 21:15:47.000000000 -0800 @@ -905,7 +905,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) _