[PATCH] mmap can return incorrect errno
authorChristopher Yeoh <cyeoh@samba.org>
Mon, 11 Feb 2002 14:50:33 +0000 (06:50 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 11 Feb 2002 14:50:33 +0000 (06:50 -0800)
commit1e54dd8a125a11fa64baa630c389cacfb905ae13
treed96580de1ada6b1d51a8f9b8ae9b9524ad61c702
parentba443ea976ef47f26d04cb1c6d755cee376a82d3
[PATCH] mmap can return incorrect errno

mmap currently sets errno to EINVAL when it should be ENOMEM.
SUS/POSIX states that ENOMEM should be returned when:

"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."

The following patch (against 2.4.17) fixes this behaviour:
mm/mmap.c