Commit graph

2602 commits

Author SHA1 Message Date
Elliott Hughes
c221beccc1 Add a missing riscv64 psabi constant.
Also group all the RELR/arm64/riscv64 bits together rather than mixing them up slightly as we'd done so far.

Change-Id: Iff1ea2cfca9ff702b88aa2e7d09db46e2f34f965
2024-06-11 12:59:38 +00:00
Elliott Hughes
988c807ff8 Merge "<malloc.h>: warn on unused results for malloc_usable_size()." into main 2024-06-05 15:48:45 +00:00
Elliott Hughes
5b57093ecc Merge "<stdio.h>: warn on some unused results." into main 2024-06-04 18:20:48 +00:00
Elliott Hughes
69ddb74135 <malloc.h>: warn on unused results for malloc_usable_size().
Not a security problem, but definitely a bug if you're calling this and ignoring the result, since it has no side-effects.

(All of the more important functions -- realloc() especially -- are already annotated.)

Change-Id: I217463518b4716befcc0ed9426648eafbfbbdde4
2024-06-04 15:32:45 +00:00
Elliott Hughes
b631ec7409 <unistd.h>: explain why getpagesize() is better than getauxval() as well as sysconf().
I thought we'd already done this, but apparently not.

Bug: http://b/315511637
Change-Id: I0581438a6f551be9750b6679a9f3ad06c83f1e9b
2024-06-03 19:19:22 +00:00
Elliott Hughes
78706d25d0 <stdio.h>: warn on some unused results.
This is fairly conservative, touching only those functions (such as feof()) where it's clearly an error to not use the return value.

Also fix a test that was ignoring the return value of feof() (because it was just checking whether the function could take the lock, and genuinely didn't care about the result).

Change-Id: If2ade10ae87df45a8b9bfcb24828e460201fa9a1
2024-05-31 22:55:22 +00:00
Elliott Hughes
d4c54b4448 Warn about unused results with bsearch().
This function has no side-effects, and the return value is the whole point.

Change-Id: Ibb9143c6a3c4089bfd6402c1c580ef76ce0f5d27
2024-05-31 17:33:33 +00:00
Elliott Hughes
c8ea872a2f Fix gettid() in functions that call fork() or equivalent.
Bug: https://github.com/android/ndk/issues/2024
Change-Id: Ia264ce219fac99e8823e60c4a2e0607af8518056
2024-05-28 15:23:52 +00:00
Elliott Hughes
a13b3b32e0 Merge "Tidy and document the inline/__inline/__inline__ situation." into main 2024-05-21 11:49:20 +00:00
Elliott Hughes
88908db595 Merge "Minor <android/dlext.h> documentation improvements." into main 2024-05-16 21:21:24 +00:00
Treehugger Robot
bdba54d9c5 Merge "Update <android/api-level.h>." into main 2024-05-16 20:35:55 +00:00
Treehugger Robot
923b48c1c5 Merge "Update <system_properties.h> documentation." into main 2024-05-16 19:57:13 +00:00
Elliott Hughes
c2622a5d4c Minor <android/dlext.h> documentation improvements.
Change-Id: I7ba1228c938e2fce858beb126e1e81620bba0459
2024-05-16 19:02:36 +00:00
Elliott Hughes
3772ae4f96 Update <system_properties.h> documentation.
Change-Id: I70de8dee963d00c480e0cb2faa9988d1d6c76d05
2024-05-16 18:45:03 +00:00
Elliott Hughes
d6c3a078bc Update <android/api-level.h>.
Change-Id: Id1522fdaf3041dcd3f296a716e8a2a1936c389e8
2024-05-16 18:31:47 +00:00
Elliott Hughes
72b10fc254 Document <link.h>.
I was only here to stop saying "Android R", which doesn't mean much to most app developers, but while I'm here...

Change-Id: I0ffd5d679747491d338064e36efc80b2b82e9e06
2024-05-16 18:10:23 +00:00
Elliott Hughes
3469e7df9b Tidy and document the inline/__inline/__inline__ situation.
We can (and should) use `inline` in C++ but not in C headers that
need to support ANSI/C89/C90. `__inline__` works everywhere, but
traditionally we've used the BSD `__inline` in public headers.

Change-Id: I920e0a1f5fcd01cf8ddd89240ef66b25c50378d7
2024-05-15 16:06:07 +00:00
Dan Albert
2237fcf1fa Revert "Use inline keyword without underscores consistently"
This reverts commit 58f06e1112.

Bare `inline` is not ANSI C compatible, and NDK users may be using
that.

Test: treehugger
Change-Id: I82c5424522142001cd59da63ef3fd440014451ad
2024-05-14 17:55:54 +00:00
Treehugger Robot
a97a4754a3 Merge "Add deprecation message for __sF." into main 2024-05-02 22:19:13 +00:00
Treehugger Robot
000745aa37 Merge "Allow deprecation messages." into main 2024-05-02 21:53:15 +00:00
Dan Albert
cc86c74362 Add deprecation message for __sF.
Bug: None
Test: treehugger
Change-Id: I9dd9e77ad024c2ea292f021bb2709378f755c1d8
2024-05-02 20:05:29 +00:00
Dan Albert
398e1aa030 Allow deprecation messages.
I'll land another patch that makes this required once I've fixed up
all the callers.

Bug: https://github.com/android/ndk/issues/2014
Test: treehugger
Change-Id: I62b9fdd3174f37d33f01c27f7f4e9134f6d9df6e
2024-05-02 20:05:28 +00:00
Treehugger Robot
cdbc7c75f5 Merge "[scudo] -1 is also valid for M_DECAY_TIME" into main 2024-04-29 20:07:46 +00:00
Chia-hung Duan
6abb406e0a [scudo] -1 is also valid for M_DECAY_TIME
Test: Run tests
Change-Id: I044ef84bf0ec97c0f8cb8d3a2340b82218d85efc
2024-04-26 15:24:24 -07:00
Elliott Hughes
5063d26249 Merge "Always use __foo__ for attribute names." into main 2024-04-23 00:12:32 +00:00
Elliott Hughes
9b9371bd0e Replace commented-out deprecated attribute with doc comment.
This attribute had been commented out since it was first
committed a decade ago. No-one's going to chase down arm32-only
trivia like that before arm32 and x86 are removed as obsolete...

Change-Id: I8e29d16657b3f4ce379e65732d747f969ea31dae
2024-04-22 20:17:22 +00:00
Elliott Hughes
a1b5ca2fe0 Always use __foo__ for attribute names.
To avoid collisions with other macros.

Change-Id: I015639043deaceccaf5f11365f8bdc45ca703da5
2024-04-22 20:10:53 +00:00
Elliott Hughes
7d3c6cd25c Document pthread_key_create(3), pthread_key_delete(3), and PTHREAD_KEYS_MAX.
In particular "how to work around the PTHREAD_KEYS_MAX limit".

Change-Id: I330936d598ddddfa0903f0505fd00f8fcbf02543
2024-04-18 22:02:38 +00:00
Christopher Ferris
785e161dd8 Merge "Update to v6.8 kernel headers." into main 2024-04-18 16:35:43 +00:00
Nick Desaulniers
ceed466d60 libc: remove __size_mul_overflow
We should just be able to use __builtin_umull_overflow now, which expects
unsigned long parameters. We don't need __builtin_umul_overflow (which expects
unsigned ints) because Bionic is LP64 or ILP32, so for ILP32
sizeof(size_t) == sizeof(unsigned long),
so __builtin_umull_overflow will work for either ILP32 or LP64.

Test: mm
Change-Id: I872491731bca05e561767f8bfeda4c6704e10ccb
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2024-04-17 14:54:57 -07:00
Nick Desaulniers
0be8f184c2 Merge "Use inline keyword without underscores consistently" into main 2024-04-17 21:19:27 +00:00
Nick Desaulniers
58f06e1112 Use inline keyword without underscores consistently
s/__inline__/inline
s/__inline/inline

Change-Id: I5d8d930a7a41d678a0795e7a608dacbb9eb8cb37
2024-04-17 10:51:09 -07:00
Florian Mayer
7d098bbee7 Fix incorrect links
Change-Id: Iee24c6b2e1a63d01359dadd5af7499fa3b4abaa5
2024-04-16 21:12:40 +00:00
Christopher Ferris
b830ddf90e Update to v6.8 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-6.8

Test: Builds and bionic unit tests pass on raven.
Test: Able to log in to an Android GO 32 bit device.
Change-Id: I0022cdb20c19726f526acaab2866f1e25794b77e
2024-04-16 09:49:56 -07:00
Treehugger Robot
e7f4506bcb Merge "Add LINE_MAX." into main 2024-04-15 23:20:22 +00:00
Steven Moreland
117478dd4e Merge "Prefer __BIONIC_DEPRECATED_PAGE_SIZE_MACRO" into main 2024-04-10 20:57:45 +00:00
Treehugger Robot
3db97c73a2 Merge "Add NGROUPS." into main 2024-04-09 19:33:36 +00:00
Elliott Hughes
e5bd239ba1 Add NGROUPS.
Historical code still uses this, and people work around its absence
locally. All of iOS/macOS and musl/glibc have this.

Change-Id: I119834f535b346275be5fa1df3c323eee9e242cc
2024-04-09 16:48:18 +00:00
Elliott Hughes
f666d822bd <sys/shm.h>: fix a hard-coded 4096 page size.
Change-Id: I932b1ea44ab6a54a2e4d2bcd1577c6f5859f583a
2024-04-09 16:40:27 +00:00
Steven Moreland
a69e5af7ee Prefer __BIONIC_DEPRECATED_PAGE_SIZE_MACRO
Platform and future NDK releases will have no PAGE_SIZE by default,
unless __BIONIC_DEPRECATED_PAGE_SIZE_MACRO is specified.

This ensures that when people use these headers with non-standard build
systems, they will still become aware of the changes.

Bug: 312546062
Test: build/boot
Change-Id: I29f5de2cd5d59d3cefdd45a6da1ccdd7c12f1f19
2024-04-09 16:35:15 +00:00
Elliott Hughes
b266f6522f Add LINE_MAX.
LINE_MAX is a bad idea from the 1970s that we've ignored until now,
but there's already one hack in the AOSP tree (external/ltp) to work
around its absence, and kselftests would need another. Both uses are
bad code, but bad code exists, and iOS/macOS and musl/glibc all have
the same 2048 value, and it is in POSIX, so at least it's consistent
idiocy. Hopefully we're not encouraging more of it!

Bug: https://github.com/llvm/llvm-project/issues/88119
Change-Id: Ief219c3fe20b3d95da7040c4b9411f997b1c0470
2024-04-09 15:41:10 +00:00
Treehugger Robot
29f233a59e Merge "sysconf()/getpagesize() documentation." into main 2024-03-27 23:25:40 +00:00
Elliott Hughes
3bfb6eeb14 sysconf()/getpagesize() documentation.
Plus a little bit of cleanup of the sysconf() implementation...

Change-Id: I017d50e537e4721c9a4c4a62e9dea771ee920fb8
2024-03-27 21:23:42 +00:00
Elliott Hughes
5a42460cc6 Merge "elf.h: add EF_RISCV_FLOAT_ABI." into main 2024-03-26 23:08:53 +00:00
Elliott Hughes
b90d6b35a6 elf.h: add EF_RISCV_FLOAT_ABI.
See code comments for details. I think everything we could reasonably
upstream from this file is now an upstream pull request. If they get in,
I'll try my luck with the arm32 TLS constant (which is a bit more
interesting because there's a probably obsolete conflict upstream, but
someone who knows about FreeBSD/arm32 would want to look at that).

Test: treehugger
Change-Id: I5bf197045940d25efb2a520716499d924c362b57
2024-03-26 19:15:42 +00:00
Elliott Hughes
edc73c5492 Improve our dlsym()/dlvsym() docs a bit more.
RTLD_DEFAULT/RTLD_NEXT already linked to the functions, but the functions should link to the constants too.

Change-Id: I854b632092f077d71918e99b3caec874e1df1ef3
2024-03-26 16:46:29 +00:00
Elliott Hughes
6bf133dc5f Remove duplicate ELF_ST_TYPE() macro.
The Linux uapi header fixed their definition in 5.19 to not have the cast that we were working around here. (See https://lkml.kernel.org/r/Ymv7G1BeX4kt3obz@localhost.localdomain for the upstream patch.)

Change-Id: Ied3368551ebb82f44f411684fe3666d06efbd22e
2024-03-22 20:46:52 +00:00
Elliott Hughes
2a70ee680c Merge "Update FreeBSD elf_common.h." into main 2024-03-22 20:40:42 +00:00
Treehugger Robot
ef9504be7d Merge "Change doc about crash_detail name" into main 2024-03-21 22:09:00 +00:00
Florian Mayer
a5d6778356 Change doc about crash_detail name
Test: none, doc change
Bug: 326097280
Change-Id: I5a79b8ac7448e564a9d72ad1c9323cea35d82227
2024-03-21 13:50:44 -07:00