mmap() was a little strict: The length parameter need not be page
aligned. It shall be rounded up by the implementation. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24967 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,7 +19,7 @@ mmap(void* address, size_t length, int protection, int flags, int fd,
|
|||||||
off_t offset)
|
off_t offset)
|
||||||
{
|
{
|
||||||
// offset and length must be page-aligned
|
// offset and length must be page-aligned
|
||||||
if (length == 0 || (offset | length) % B_PAGE_SIZE != 0) {
|
if (length == 0 || offset % B_PAGE_SIZE != 0) {
|
||||||
errno = B_BAD_VALUE;
|
errno = B_BAD_VALUE;
|
||||||
return MAP_FAILED;
|
return MAP_FAILED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user