diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2026-04-04 18:26:05 +0300 |
|---|---|---|
| committer | Thomas Weißschuh <linux@weissschuh.net> | 2026-04-27 10:00:52 +0300 |
| commit | e635b0459ae9533d57f5816aad1793ccb9d7d097 (patch) | |
| tree | e30708d2c1729fbfe5f466e7632a2b6254c7a3d4 /include/linux/debugobjects.h | |
| parent | 80e5de852e3a619ff83e0347a5766b34fdc8aa78 (diff) | |
| download | linux-e635b0459ae9533d57f5816aad1793ccb9d7d097.tar.xz | |
tools/nolibc: make __nolibc_enosys() a compile time error
Functions which are known at compile-time to result in ENOSYS can be
surprising to the user. For example using old UAPI headers might mean
that stat() will always fail although the kernel would have the system
call available at runtime. Nowadays __nolibc_enosys() should never be
called for normal applications.
Switch the silent ENOSYS return into a compile-time error, so the user
is aware about the issue. Prefer the 'error' attribute as it provides
the best diagnostics. If the users defines NOLIBC_COMPILE_TIME_ENOSYS
the old, silent fallback is kept.
Also add a test which validates that the error can be optimized away.
Reported-by: Willy Tarreau <w@1wt.eu>
Closes: https://lore.kernel.org/lkml/acizRIq2xrFUNHNS@1wt.eu/
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-enosys-v1-1-e0aba47bdee4@weissschuh.net
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
