Skip to content

Commit

Permalink
Only rename mmap to mmap64 if we're L or newer.
Browse files Browse the repository at this point in the history
Without this, setting `__USE_FILE_OFFSET64` and targeting pre-L made
mmap entirely unavailable.

Test: make checkbuild
Bug: android/ndk#332
Change-Id: I9f61c44f8d9ab5c7cae845c9f89a7d889c6df365
  • Loading branch information
DanAlbert committed Mar 17, 2017
1 parent 616b2d8 commit 0463858
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/include/sys/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ __BEGIN_DECLS
#define POSIX_MADV_WILLNEED MADV_WILLNEED
#define POSIX_MADV_DONTNEED MADV_DONTNEED

#if defined(__USE_FILE_OFFSET64)
#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= 21
void* mmap(void*, size_t, int, int, int, off_t) __RENAME(mmap64) __INTRODUCED_IN(21);
#else
void* mmap(void*, size_t, int, int, int, off_t);
Expand Down

0 comments on commit 0463858

Please sign in to comment.