From 9b293bf65318dde200b1bb1e3487f5f76cde97b5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 15 Apr 2008 14:22:50 +0000 Subject: [PATCH] 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 --- src/system/libroot/posix/sys/mman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/libroot/posix/sys/mman.cpp b/src/system/libroot/posix/sys/mman.cpp index cc9a98f56d..615030633b 100644 --- a/src/system/libroot/posix/sys/mman.cpp +++ b/src/system/libroot/posix/sys/mman.cpp @@ -19,7 +19,7 @@ mmap(void* address, size_t length, int protection, int flags, int fd, off_t offset) { // 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; return MAP_FAILED; }