ChangeSet 1.2231.1.141, 2005/03/28 19:55:43-08:00, [EMAIL PROTECTED]

        [PATCH] fix mmap() return value to conform POSIX
        
        This patch fixes 2 return values in mmap() to conform POSIX spec:
        
        [EINVAL]
                The value of len is zero.
              
        [ENOMEM]
                MAP_FIXED was specified, and the range [addr,addr+len) exceeds
                that allowed for the address space of a process; or, if
                MAP_FIXED was not specified and there is insufficient room in
                the address space to effect the mapping.
        
        
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 mmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c 2005-03-28 21:37:32 -08:00
+++ b/mm/mmap.c 2005-03-28 21:37:32 -08:00
@@ -896,12 +896,12 @@
                        prot |= PROT_EXEC;
 
        if (!len)
-               return addr;
+               return -EINVAL;
 
        /* Careful about overflows.. */
        len = PAGE_ALIGN(len);
        if (!len || len > TASK_SIZE)
-               return -EINVAL;
+               return -ENOMEM;
 
        /* offset overflow? */
        if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to