Commit baad4c95 authored by Kalesh Singh's avatar Kalesh Singh
Browse files

ANDROID: 16K: Emulate pread() for pagemap



pread() can read from a specified offset of the file without
changing the files offset position.

In the case of reading /proc/*/pagemap with pread() in an emulated
16KB x86_64 device, userspace believes the pages are large than
they actually are; we adjust the start offset of the pread to emulate
reading the correct page map entries. Adjustment of the count is
handled by .pagemap_read() which will be called by the VFS layer.

This is effectively a no-op in the page size isn't being emulated.

Bug: 385167611
Test: atest vts_ltp_test_x86_64:syscalls.msync04_64bit#syscalls.msync04_64bit
Test: atest vts_ltp_test_x86_64:syscalls.mmap12_64bit#syscalls.mmap12_64bit
Test: atest libmeminfo_test
Test: atest bionic-unit-tests:DlExtRelroSharingTest#VerifyMemorySaving
Note: bionic-unit-tests must be run as root (add require_root: true)
Change-Id: I139d510d7fdb7040236e01a2dc9ee9d5c9c207fd
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
parent 0715c0e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment