diff options
author | Steven Moreland <smoreland@google.com> | 2024-04-10 20:57:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-10 20:57:45 +0000 |
commit | 117478dd4ea3225ef897bcc3b4afb5e709d9c467 (patch) | |
tree | 902d117a6e8cfb031989cdfd76bf4a902533a4f6 | |
parent | 4435aff516386fad9694b38eedb55032e0027381 (diff) | |
parent | a69e5af7ee56875508a750be0ac1eaba92b4a2c0 (diff) | |
download | bionic-117478dd4ea3225ef897bcc3b4afb5e709d9c467.tar.gz |
Merge "Prefer __BIONIC_DEPRECATED_PAGE_SIZE_MACRO" into main
-rw-r--r-- | libc/include/bits/page_size.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libc/include/bits/page_size.h b/libc/include/bits/page_size.h index df0cb7fcc..594ffe5e8 100644 --- a/libc/include/bits/page_size.h +++ b/libc/include/bits/page_size.h @@ -32,7 +32,16 @@ __BEGIN_DECLS -#if !defined(__BIONIC_NO_PAGE_SIZE_MACRO) || defined(__BIONIC_DEPRECATED_PAGE_SIZE_MACRO) +// PAGE_SIZE is going away in Android. Prefer getpagesize() instead. +// +// For more info, see https://developer.android.com/16kb-page-size. +// +// To restore the original behavior, use __BIONIC_DEPRECATED_PAGE_SIZE_MACRO. + +#if (defined(__NDK_MAJOR__) && __NDK_MAJOR__ <= 27 && !defined(__BIONIC_NO_PAGE_SIZE_MACRO)) \ + || defined(__BIONIC_DEPRECATED_PAGE_SIZE_MACRO) \ + || defined(__arm__) \ + || defined(__i386__) #define PAGE_SIZE 4096 #define PAGE_MASK (~(PAGE_SIZE - 1)) #endif |