diff options
author | Elliott Hughes <enh@google.com> | 2023-06-23 18:29:51 +0000 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2023-06-23 22:40:57 +0000 |
commit | c77993eda368e86d522d3fa6c75f0440f83f6ef3 (patch) | |
tree | 0b7cf3a2bc32a33706549408d194b1252bb2984d /libc/include/unistd.h | |
parent | 0e437c00e0ec6ebd7915c9d58993754d91c713ff (diff) | |
download | bionic-c77993eda368e86d522d3fa6c75f0440f83f6ef3.tar.gz |
Mark getpagesize() const.
If folks want to use this instead of PAGE_SIZE, let's let the compiler
know that it doesn't need to be called more than once. Using "const"
rather than "pure" lets us cover more cases, and although this function
may need to check global state, it's _immutable_ global state, so it's
effectively "const".
Test: llvm-objdump -d
Change-Id: I0b13de79d44b57545258121df7cdd6490a9a5be1
Diffstat (limited to 'libc/include/unistd.h')
-rw-r--r-- | libc/include/unistd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/include/unistd.h b/libc/include/unistd.h index 98fab5259..93852649a 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -302,7 +302,7 @@ int ttyname_r(int __fd, char* _Nonnull __buf, size_t __buf_size); int acct(const char* _Nullable __path); -int getpagesize(void); +int getpagesize(void) __attribute_const__; long syscall(long __number, ...); |