aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/mmap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* bionic: Add flag to restore legacy mmap behaviorFlemmard2015-10-191-1/+6
| | | | | | | | | | * Pre-lollipop mmap would not care whether offset was signed or unsigned. * Lollipop adds 64-bit support which results in sign extension of offset, causing a negative offset when a positive offset > 2^31 is given. Change-Id: I5d19d898fc131cf848217974915d1b466a474f99
* If the kernel doesn't have MADV_MERGEABLE, stop asking for it.Elliott Hughes2014-03-031-2/+9
| | | | | | | | | Note that a dynamically-linked binary will still probably see two attempts --- one by the dynamic linker (which will set its copy of the flag so it won't try again) and then one by the executable itself (which gets a new uninitialized copy of the flag). Change-Id: Id6b7e47780f0f24d2ca0384a75373f4824fa8f12
* Fix 32-bit mmap/mmap64 handling of negative offsets.Elliott Hughes2014-01-271-5/+3
| | | | | | | | | | We don't actually need to worry about sign extension if we reject negative values ourselves. Previously it was possible to come up with negative but aligned values that we would pass to the kernel; in the case of mmap (as opposed to mmap64) we'd incorrectly turn those into large positive offsets. Change-Id: I2aa583e0f892d59bb77429aea8730b72db32dcb0
* Avoid sign extension in 32-bit mmap.Elliott Hughes2013-12-201-1/+1
| | | | Change-Id: I2a77925f62f381a0b34648c3db8154a55dd80c46
* Add mmap64()Daniel Leung2013-09-191-2/+6
| | | | | | | | | | | | This adds mmap64() to bionic so that it is possible to have large offset passed to kernel. However, the syscall mechanism only passes 32-bit number to kernel. So effectively, the largest offset that can be passed is about 43 bits (since offset is signed, and the number passed to kernel is number of pages (page size == 4K => 12 bits)). Change-Id: Ib54f4e9b54acb6ef8b0324f3b89c9bc810b07281 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* Avoid sign extension of the mmap offset.Elliott Hughes2013-07-251-2/+3
| | | | | | | off_t is signed to support seeking backwards, but that's a liability when using off_t to represent a subset of a file. Change-Id: I2a3615166eb16212347eb47f1242e3bfb93c2022
* Prevent the madvise(MADV_MERGEABLE) mmap hack from affecting errno.Elliott Hughes2013-07-171-0/+54
Bug: 9889616 Change-Id: I4a7323e0ae5aeb5cbe0da1b2bc7501d83b3a2aa4