aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-02-04 10:29:04 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-11-13 12:59:19 -0300
commit01bd62517cc242ae503aaa7002e9e94551803e4d (patch)
tree4eb2b077db03794483dffa01795addead2eb88ef /sysdeps/unix
parent26f7c72a99f4e46755ec2ff23a6a7cf9c2c337c3 (diff)
downloadglibc-01bd62517cc242ae503aaa7002e9e94551803e4d.zip
glibc-01bd62517cc242ae503aaa7002e9e94551803e4d.tar.gz
glibc-01bd62517cc242ae503aaa7002e9e94551803e4d.tar.bz2
Remove tls.h inclusion from internal errno.h
The tls.h inclusion is not really required and limits possible definition on more arch specific headers. This is a cleanup to allow inline functions on sysdep.h, more specifically on i386 and ia64 which requires to access some tls definitions its own. No semantic changes expected, checked with a build against all affected ABIs.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/adjtime.c1
-rw-r--r--sysdeps/unix/sysv/linux/clock_getcpuclockid.c1
-rw-r--r--sysdeps/unix/sysv/linux/faccessat.c6
-rw-r--r--sysdeps/unix/sysv/linux/ftime.c1
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/generic/chmod.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/chown.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/dup2.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/epoll_create.c5
-rw-r--r--sysdeps/unix/sysv/linux/generic/inotify_init.c5
-rw-r--r--sysdeps/unix/sysv/linux/generic/lchown.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/link.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/pipe.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/readlink.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/rmdir.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/symlink.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/unlink.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h1
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c2
-rw-r--r--sysdeps/unix/sysv/linux/getentropy.c1
-rw-r--r--sysdeps/unix/sysv/linux/getrlimit.c3
-rw-r--r--sysdeps/unix/sysv/linux/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/gettimeofday.c7
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/internal-signals.h1
-rw-r--r--sysdeps/unix/sysv/linux/libc_fatal.c2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/mknodat.c1
-rw-r--r--sysdeps/unix/sysv/linux/netlink_assert_response.c1
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise64.c1
-rw-r--r--sysdeps/unix/sysv/linux/prlimit.c4
-rw-r--r--sysdeps/unix/sysv/linux/readahead.c2
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sysconf.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c2
-rw-r--r--sysdeps/unix/sysv/linux/semop.c2
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit.c3
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/settimezone.c1
-rw-r--r--sysdeps/unix/sysv/linux/shmget.c3
-rw-r--r--sysdeps/unix/sysv/linux/socketcall.h2
-rw-r--r--sysdeps/unix/sysv/linux/speed.c2
-rw-r--r--sysdeps/unix/sysv/linux/statx.c2
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/sysdep.h1
-rw-r--r--sysdeps/unix/sysv/linux/truncate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/ustat.c2
-rw-r--r--sysdeps/unix/sysv/linux/xmknod.c1
-rw-r--r--sysdeps/unix/sysv/linux/xmknodat.c1
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.c1
52 files changed, 59 insertions, 59 deletions
diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c
index 6d1d1b6..8e7c8cc 100644
--- a/sysdeps/unix/sysv/linux/adjtime.c
+++ b/sysdeps/unix/sysv/linux/adjtime.c
@@ -19,6 +19,7 @@
#include <limits.h>
#include <sys/time.h>
#include <sys/timex.h>
+#include <sysdep.h>
#define MAX_SEC (INT_MAX / 1000000L - 2)
#define MIN_SEC (INT_MIN / 1000000L + 2)
diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
index 7d2e6d6..1eb780a 100644
--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
@@ -20,6 +20,7 @@
#include <time.h>
#include <unistd.h>
#include "kernel-posix-cpu-timers.h"
+#include <sysdep.h>
#include <shlib-compat.h>
int
diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
index b697053..5d07837 100644
--- a/sysdeps/unix/sysv/linux/faccessat.c
+++ b/sysdeps/unix/sysv/linux/faccessat.c
@@ -16,14 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include <sys/types.h>
-#include <alloca.h>
+#include <sys/stat.h>
#include <sysdep.h>
diff --git a/sysdeps/unix/sysv/linux/ftime.c b/sysdeps/unix/sysv/linux/ftime.c
index 1755fcf..2f43b76 100644
--- a/sysdeps/unix/sysv/linux/ftime.c
+++ b/sysdeps/unix/sysv/linux/ftime.c
@@ -18,6 +18,7 @@
#include <features.h>
#include <sys/timeb.h>
+#include <time.h>
#include <errno.h>
int
diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c
index 606a0e8..3d43a5a 100644
--- a/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -17,7 +17,6 @@
#include <unistd.h>
#include <sysdep.h>
-#include <errno.h>
#ifndef __NR_ftruncate64
# define __NR_ftruncate64 __NR_ftruncate
diff --git a/sysdeps/unix/sysv/linux/generic/chmod.c b/sysdeps/unix/sysv/linux/generic/chmod.c
index b9631a9..802e400 100644
--- a/sysdeps/unix/sysv/linux/generic/chmod.c
+++ b/sysdeps/unix/sysv/linux/generic/chmod.c
@@ -16,11 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <fcntl.h>
-#include <sys/stat.h>
#include <sys/types.h>
+#include <sysdep.h>
/* Change the protections of FILE to MODE. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/chown.c b/sysdeps/unix/sysv/linux/generic/chown.c
index d676eef..57a8183 100644
--- a/sysdeps/unix/sysv/linux/generic/chown.c
+++ b/sysdeps/unix/sysv/linux/generic/chown.c
@@ -16,11 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/types.h>
+#include <sysdep.h>
/* Change the owner and group of FILE. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/dup2.c b/sysdeps/unix/sysv/linux/generic/dup2.c
index 32592f9..dfa348b 100644
--- a/sysdeps/unix/sysv/linux/generic/dup2.c
+++ b/sysdeps/unix/sysv/linux/generic/dup2.c
@@ -16,10 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
#include <unistd.h>
+#include <sysdep.h>
/* Duplicate FD to FD2, closing the old FD2 and making FD2 be
open the same file as FD is. Return FD2 or -1. */
diff --git a/sysdeps/unix/sysv/linux/generic/epoll_create.c b/sysdeps/unix/sysv/linux/generic/epoll_create.c
index e3eac4a..1715c6d 100644
--- a/sysdeps/unix/sysv/linux/generic/epoll_create.c
+++ b/sysdeps/unix/sysv/linux/generic/epoll_create.c
@@ -16,11 +16,8 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <stddef.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/epoll.h>
+#include <sysdep.h>
libc_hidden_proto (epoll_create)
diff --git a/sysdeps/unix/sysv/linux/generic/inotify_init.c b/sysdeps/unix/sysv/linux/generic/inotify_init.c
index 7f84124..25a323f 100644
--- a/sysdeps/unix/sysv/linux/generic/inotify_init.c
+++ b/sysdeps/unix/sysv/linux/generic/inotify_init.c
@@ -16,11 +16,8 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <stddef.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/inotify.h>
+#include <sysdep.h>
libc_hidden_proto (inotify_init)
diff --git a/sysdeps/unix/sysv/linux/generic/lchown.c b/sysdeps/unix/sysv/linux/generic/lchown.c
index a483241..379079e 100644
--- a/sysdeps/unix/sysv/linux/generic/lchown.c
+++ b/sysdeps/unix/sysv/linux/generic/lchown.c
@@ -16,11 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/types.h>
+#include <sysdep.h>
/* Change the owner and group of FILE. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/link.c b/sysdeps/unix/sysv/linux/generic/link.c
index a038ba1..1baa6b5 100644
--- a/sysdeps/unix/sysv/linux/generic/link.c
+++ b/sysdeps/unix/sysv/linux/generic/link.c
@@ -16,10 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sysdep.h>
/* Make a link to FROM called TO. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/pipe.c b/sysdeps/unix/sysv/linux/generic/pipe.c
index 5d4a95f..52f3231 100644
--- a/sysdeps/unix/sysv/linux/generic/pipe.c
+++ b/sysdeps/unix/sysv/linux/generic/pipe.c
@@ -16,9 +16,8 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <unistd.h>
-#include <stddef.h>
+#include <sysdep.h>
/* Create a one-way communication channel (__pipe).
If successful, two file descriptors are stored in PIPEDES;
diff --git a/sysdeps/unix/sysv/linux/generic/readlink.c b/sysdeps/unix/sysv/linux/generic/readlink.c
index 721f84e..6f690a9 100644
--- a/sysdeps/unix/sysv/linux/generic/readlink.c
+++ b/sysdeps/unix/sysv/linux/generic/readlink.c
@@ -16,9 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sysdep.h>
/* Read the contents of the symbolic link PATH into no more than
LEN bytes of BUF. The contents are not null-terminated.
diff --git a/sysdeps/unix/sysv/linux/generic/rmdir.c b/sysdeps/unix/sysv/linux/generic/rmdir.c
index e357a10..f9d721f 100644
--- a/sysdeps/unix/sysv/linux/generic/rmdir.c
+++ b/sysdeps/unix/sysv/linux/generic/rmdir.c
@@ -16,11 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
-
+#include <sysdep.h>
/* Remove the directory PATH. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/symlink.c b/sysdeps/unix/sysv/linux/generic/symlink.c
index cddc11a..2c358f5 100644
--- a/sysdeps/unix/sysv/linux/generic/symlink.c
+++ b/sysdeps/unix/sysv/linux/generic/symlink.c
@@ -16,10 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sysdep.h>
/* Make a link to FROM called TO. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/unlink.c b/sysdeps/unix/sysv/linux/generic/unlink.c
index 7908d0a..8df5575 100644
--- a/sysdeps/unix/sysv/linux/generic/unlink.c
+++ b/sysdeps/unix/sysv/linux/generic/unlink.c
@@ -16,11 +16,9 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
-
+#include <sysdep.h>
/* Remove the link named NAME. */
int
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c
index 93d9d94..f80b56b 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c
@@ -16,10 +16,10 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/statfs.h>
#include <kernel_stat.h>
#include <stddef.h>
+#include <sysdep.h>
#if !STATFS_IS_STATFS64
#include "overflow.h"
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
index c5e0286..e200f63 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <sys/statfs.h>
+#include <sys/types.h>
/* Test for overflows of structures where we ask the kernel to fill them
in with standard 64-bit syscalls but return them through APIs that
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c
index c556a37..72e2d49 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c
@@ -17,7 +17,9 @@
<https://www.gnu.org/licenses/>. */
#include <sys/sendfile.h>
+#include <stddef.h>
#include <errno.h>
+#include <sysdep.h>
/* Send COUNT bytes from file associated with IN_FD starting at OFFSET to
descriptor OUT_FD. */
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c
index 7421501..4484341 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c
@@ -19,7 +19,7 @@
#include <errno.h>
#include <sys/statfs.h>
#include <kernel_stat.h>
-#include <stddef.h>
+#include <sysdep.h>
#if !STATFS_IS_STATFS64
#include "overflow.h"
diff --git a/sysdeps/unix/sysv/linux/getentropy.c b/sysdeps/unix/sysv/linux/getentropy.c
index 2f3a4e4..02cf46f 100644
--- a/sysdeps/unix/sysv/linux/getentropy.c
+++ b/sysdeps/unix/sysv/linux/getentropy.c
@@ -20,6 +20,7 @@
#include <assert.h>
#include <errno.h>
#include <unistd.h>
+#include <sysdep.h>
/* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on
success and -1 on failure. */
diff --git a/sysdeps/unix/sysv/linux/getrlimit.c b/sysdeps/unix/sysv/linux/getrlimit.c
index ecb34dd..339d943 100644
--- a/sysdeps/unix/sysv/linux/getrlimit.c
+++ b/sysdeps/unix/sysv/linux/getrlimit.c
@@ -16,9 +16,8 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/resource.h>
-#include <sys/types.h>
+#include <sysdep.h>
#include <shlib-compat.h>
#if !__RLIM_T_MATCHES_RLIM64_T
diff --git a/sysdeps/unix/sysv/linux/getrlimit64.c b/sysdeps/unix/sysv/linux/getrlimit64.c
index 0f9a2f4..e06ffd1 100644
--- a/sysdeps/unix/sysv/linux/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/getrlimit64.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <sys/types.h>
+#include <sysdep.h>
#include <shlib-compat.h>
/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c
index cb57bc9..1c92e6d 100644
--- a/sysdeps/unix/sysv/linux/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/gettimeofday.c
@@ -16,15 +16,16 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <time.h>
+#include <string.h>
+
/* Optimize the function call by setting the PLT directly to vDSO symbol. */
#ifdef USE_IFUNC_GETTIMEOFDAY
-# include <time.h>
-# include <string.h>
# include <sysdep.h>
# include <sysdep-vdso.h>
# ifdef SHARED
-# include <dl-vdso.h>
+# include <dl-vdso.h>
# include <libc-vdso.h>
static int
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h
index 7f8da30..531fe2b 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep.h
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -28,6 +28,8 @@
/* Defines RTLD_PRIVATE_ERRNO. */
#include <dl-sysdep.h>
+#include <tls.h>
+
/* In order to get __set_errno() definition in INLINE_SYSCALL. */
#ifndef __ASSEMBLER__
#include <errno.h>
diff --git a/sysdeps/unix/sysv/linux/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h
index 35f2de0..8455ca8 100644
--- a/sysdeps/unix/sysv/linux/internal-signals.h
+++ b/sysdeps/unix/sysv/linux/internal-signals.h
@@ -23,6 +23,7 @@
#include <sigsetops.h>
#include <stdbool.h>
#include <limits.h>
+#include <stddef.h>
#include <sysdep.h>
/* The signal used for asynchronous cancelation. */
diff --git a/sysdeps/unix/sysv/linux/libc_fatal.c b/sysdeps/unix/sysv/linux/libc_fatal.c
index 7e22c0f..6f568ee 100644
--- a/sysdeps/unix/sysv/linux/libc_fatal.c
+++ b/sysdeps/unix/sysv/linux/libc_fatal.c
@@ -18,6 +18,8 @@
#include <errno.h>
#include <sys/uio.h>
+#include <stdbool.h>
+#include <sysdep.h>
static bool
writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
index d500172..6fd96ad 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
@@ -26,6 +26,8 @@
/* Defines RTLD_PRIVATE_ERRNO. */
#include <dl-sysdep.h>
+#include <tls.h>
+
/* In order to get __set_errno() definition in INLINE_SYSCALL. */
#ifndef __ASSEMBLER__
# include <errno.h>
diff --git a/sysdeps/unix/sysv/linux/mknodat.c b/sysdeps/unix/sysv/linux/mknodat.c
index fdb8f19..279a440 100644
--- a/sysdeps/unix/sysv/linux/mknodat.c
+++ b/sysdeps/unix/sysv/linux/mknodat.c
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
+#include <sysdep.h>
int
__mknodat (int fd, const char *path, mode_t mode, dev_t dev)
diff --git a/sysdeps/unix/sysv/linux/netlink_assert_response.c b/sysdeps/unix/sysv/linux/netlink_assert_response.c
index 5fc0920..5bacf73 100644
--- a/sysdeps/unix/sysv/linux/netlink_assert_response.c
+++ b/sysdeps/unix/sysv/linux/netlink_assert_response.c
@@ -19,6 +19,7 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdbool.h>
#include <sys/socket.h>
#include "netlinkaccess.h"
diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c
index 9787ab4..7323c82 100644
--- a/sysdeps/unix/sysv/linux/posix_fadvise64.c
+++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c
@@ -17,6 +17,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <sysdep.h>
#include <shlib-compat.h>
int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
diff --git a/sysdeps/unix/sysv/linux/prlimit.c b/sysdeps/unix/sysv/linux/prlimit.c
index aa74a52..e12eb4e 100644
--- a/sysdeps/unix/sysv/linux/prlimit.c
+++ b/sysdeps/unix/sysv/linux/prlimit.c
@@ -15,10 +15,8 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/resource.h>
-#include <sys/syscall.h>
-
+#include <sysdep.h>
int
prlimit (__pid_t pid, enum __rlimit_resource resource,
diff --git a/sysdeps/unix/sysv/linux/readahead.c b/sysdeps/unix/sysv/linux/readahead.c
index a189c3a..ad01a0a 100644
--- a/sysdeps/unix/sysv/linux/readahead.c
+++ b/sysdeps/unix/sysv/linux/readahead.c
@@ -17,7 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <fcntl.h>
-#include <errno.h>
+#include <sys/types.h>
#include <sysdep.h>
ssize_t
diff --git a/sysdeps/unix/sysv/linux/riscv/sysconf.c b/sysdeps/unix/sysv/linux/riscv/sysconf.c
index 02b469c..5a99577 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysconf.c
+++ b/sysdeps/unix/sysv/linux/riscv/sysconf.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/auxv.h>
+#include <stdbool.h>
static long int linux_sysconf (int name);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
index e4b8251..fa4b244 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
@@ -19,7 +19,7 @@
#include <sys/types.h>
#include <utmp.h>
#include <errno.h>
-#include <libc-symbols.h>
+#include <stdlib.h>
#include "utmp32.h"
#include "utmp-convert.h"
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
index 3f78fa6..bdfe396 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
@@ -19,7 +19,7 @@
#include <sys/types.h>
#include <utmp.h>
#include <errno.h>
-#include <libc-symbols.h>
+#include <stdlib.h>
#include "utmp32.h"
#include "utmp-convert.h"
diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c
index e955f0c..ab790ea 100644
--- a/sysdeps/unix/sysv/linux/semop.c
+++ b/sysdeps/unix/sysv/linux/semop.c
@@ -17,9 +17,9 @@
<https://www.gnu.org/licenses/>. */
#include <sys/sem.h>
+#include <stddef.h>
#include <ipc_priv.h>
#include <sysdep.h>
-#include <errno.h>
/* Perform user-defined atomical operation of array of semaphores. */
diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c
index 8611d57..6648fad 100644
--- a/sysdeps/unix/sysv/linux/setrlimit.c
+++ b/sysdeps/unix/sysv/linux/setrlimit.c
@@ -16,9 +16,8 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/resource.h>
-#include <sys/types.h>
+#include <sysdep.h>
#include <shlib-compat.h>
#if !__RLIM_T_MATCHES_RLIM64_T
diff --git a/sysdeps/unix/sysv/linux/setrlimit64.c b/sysdeps/unix/sysv/linux/setrlimit64.c
index e4c5bab..02c94e3 100644
--- a/sysdeps/unix/sysv/linux/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/setrlimit64.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <sys/types.h>
+#include <sysdep.h>
#include <shlib-compat.h>
/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
diff --git a/sysdeps/unix/sysv/linux/settimezone.c b/sysdeps/unix/sysv/linux/settimezone.c
index fa46386..1639562 100644
--- a/sysdeps/unix/sysv/linux/settimezone.c
+++ b/sysdeps/unix/sysv/linux/settimezone.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <sys/time.h>
+#include <stddef.h>
#include <sysdep.h>
/* Set the system-wide timezone.
diff --git a/sysdeps/unix/sysv/linux/shmget.c b/sysdeps/unix/sysv/linux/shmget.c
index 71de81c..6ea7883 100644
--- a/sysdeps/unix/sysv/linux/shmget.c
+++ b/sysdeps/unix/sysv/linux/shmget.c
@@ -16,9 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <sys/msg.h>
+#include <stddef.h>
#include <ipc_priv.h>
#include <sysdep.h>
-#include <errno.h>
/* Return an identifier for an shared memory segment of at least size SIZE
which is associated with KEY. */
diff --git a/sysdeps/unix/sysv/linux/socketcall.h b/sysdeps/unix/sysv/linux/socketcall.h
index 75c2a64..b9975f9 100644
--- a/sysdeps/unix/sysv/linux/socketcall.h
+++ b/sysdeps/unix/sysv/linux/socketcall.h
@@ -19,6 +19,8 @@
#ifndef _SYS_SOCKETCALL_H
#define _SYS_SOCKETCALL_H 1
+#include <sysdep.h>
+
/* Define unique numbers for the operations permitted on socket. Linux
uses a single system call for all these functions. The relevant code
file is /usr/include/linux/net.h.
diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c
index c02a06a..d7d74dd 100644
--- a/sysdeps/unix/sysv/linux/speed.c
+++ b/sysdeps/unix/sysv/linux/speed.c
@@ -19,7 +19,7 @@
#include <stddef.h>
#include <errno.h>
#include <termios.h>
-
+#include <sysdep.h>
/* This is a gross hack around a kernel bug. If the cfsetispeed functions
is called with the SPEED argument set to zero this means use the same
diff --git a/sysdeps/unix/sysv/linux/statx.c b/sysdeps/unix/sysv/linux/statx.c
index 9721fc1..cea6eef 100644
--- a/sysdeps/unix/sysv/linux/statx.c
+++ b/sysdeps/unix/sysv/linux/statx.c
@@ -18,7 +18,7 @@
#include <errno.h>
#include <sys/stat.h>
-
+#include <sysdep.h>
#include "statx_generic.c"
int
diff --git a/sysdeps/unix/sysv/linux/sysctl.c b/sysdeps/unix/sysv/linux/sysctl.c
index 389b958..479ba38 100644
--- a/sysdeps/unix/sysv/linux/sysctl.c
+++ b/sysdeps/unix/sysv/linux/sysctl.c
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <stddef.h>
#include <shlib-compat.h>
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index 5e7b6c5..71ecc19 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -20,6 +20,7 @@
#include <bits/wordsize.h>
#include <kernel-features.h>
+#include <endian.h>
#include <errno.h>
#undef INTERNAL_SYSCALL_ERROR_P
diff --git a/sysdeps/unix/sysv/linux/truncate64.c b/sysdeps/unix/sysv/linux/truncate64.c
index d4b4657..ac43a2b 100644
--- a/sysdeps/unix/sysv/linux/truncate64.c
+++ b/sysdeps/unix/sysv/linux/truncate64.c
@@ -17,7 +17,6 @@
#include <unistd.h>
#include <sysdep.h>
-#include <errno.h>
#ifndef __NR_truncate64
# define __NR_truncate64 __NR_truncate
diff --git a/sysdeps/unix/sysv/linux/ustat.c b/sysdeps/unix/sysv/linux/ustat.c
index 51f20a2..e38b792 100644
--- a/sysdeps/unix/sysv/linux/ustat.c
+++ b/sysdeps/unix/sysv/linux/ustat.c
@@ -23,7 +23,7 @@
#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_28)
# include <sysdep.h>
-# include <errno.h>
+# include <sys/types.h>
# ifndef DEV_TO_KDEV
# define DEV_TO_KDEV(__dev) \
diff --git a/sysdeps/unix/sysv/linux/xmknod.c b/sysdeps/unix/sysv/linux/xmknod.c
index 82bb0bd..10e874a 100644
--- a/sysdeps/unix/sysv/linux/xmknod.c
+++ b/sysdeps/unix/sysv/linux/xmknod.c
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#include <sysdep.h>
#include <shlib-compat.h>
#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
diff --git a/sysdeps/unix/sysv/linux/xmknodat.c b/sysdeps/unix/sysv/linux/xmknodat.c
index fae3fe5..17ffea1 100644
--- a/sysdeps/unix/sysv/linux/xmknodat.c
+++ b/sysdeps/unix/sysv/linux/xmknodat.c
@@ -17,6 +17,7 @@
#include <sys/stat.h>
#include <errno.h>
+#include <sysdep.h>
#include <shlib-compat.h>
#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
diff --git a/sysdeps/unix/sysv/linux/xstatconv.c b/sysdeps/unix/sysv/linux/xstatconv.c
index 3622a82..b100e07 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/xstatconv.c
@@ -19,6 +19,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <kernel_stat.h>
+#include <sysdep.h>
#if STAT_IS_KERNEL_STAT