From: Marc-Christian Petersen <m.c.p@wolk-project.de>
2.4 patch from Adrian Bunk.
ERRORS
The mprotect() function shall fail if:
...
[ENOMEM]
Addresses in the range [addr,addr+len) are invalid for the
address space of a process, or specify one or more pages which are
not mapped.
len = PAGE_ALIGN(len);
end = start + len;
if (end < start)
- return -EINVAL;
+ return -ENOMEM;
if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM))
return -EINVAL;
if (end == start)