summaryrefslogtreecommitdiffstats
path: root/tools/include/nolibc/unistd.h
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2023-01-09 08:54:40 +0100
committerPaul E. McKenney <paulmck@kernel.org>2023-01-09 09:36:05 -0800
commit55abdd1f5e1e07418bf4a46c233a92f83cb5ae97 (patch)
treed664257b07827923bedf18d9fe37f43a9f72fa78 /tools/include/nolibc/unistd.h
parent184177c3d6e023da934761e198c281344d7dd65b (diff)
downloadlinux-55abdd1f5e1e07418bf4a46c233a92f83cb5ae97.tar.bz2
tools/nolibc: fix missing includes causing build issues at -O0
After the nolibc includes were split to facilitate portability from standard libcs, programs that include only what they need may miss some symbols which are needed by libgcc. This is the case for raise() which is needed by the divide by zero code in some architectures for example. Regardless, being able to include only the apparently needed files is convenient. Instead of trying to move all exported definitions to a single file, since this can change over time, this patch takes another approach consisting in including the nolibc header at the end of all standard include files. This way their types and functions are already known at the moment of inclusion, and including any single one of them is sufficient to bring all the required ones. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc/unistd.h')
-rw-r--r--tools/include/nolibc/unistd.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h
index 1c25e20ee360..1cfcd52106a4 100644
--- a/tools/include/nolibc/unistd.h
+++ b/tools/include/nolibc/unistd.h
@@ -51,4 +51,7 @@ int tcsetpgrp(int fd, pid_t pid)
return ioctl(fd, TIOCSPGRP, &pid);
}
+/* make sure to include all global symbols */
+#include "nolibc.h"
+
#endif /* _NOLIBC_UNISTD_H */