Skip to contentSkip to conversation

fix mmap() return value to conform to POSIX

PATCH New Hong Liu 1 participant 1 message Mar 21, 2005

Subsystems (2)
lore
Share & tools
lore

Hong Liu

author
#0 lore raw

PATCH 1/1 fix mmap() return value to conform to POSIX

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.

mm/mmap.c 2005-03-16 14:10:16.167338840 +0800 renamed from mm/mmap.c.orig 2005-03-16 14:08:59.116052416 +0800 +0 -0
@@ -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)