public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6] fix mmap() return value to conform to POSIX
@ 2005-03-21 10:26 Hong Liu
  0 siblings, 0 replies; only message in thread
From: Hong Liu @ 2005-03-21 10:26 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

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)



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-21 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-21 10:26 [PATCH 2.6] fix mmap() return value to conform to POSIX Hong Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox