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
This patch fixes a corner case in sys_mprotect():
Case: len is so large that will overflow to 0 after page alignment.
E.g. len=(size_t)(-1), i.e. 0xff...ff.
Expected result: POSIX spec says it should return -ENOMEM.
Current result: len is aligned to 0, then treated the same as len=0 and
return su
2 matches
Mail list logo