diff --git a/bits/fcntl.h b/bits/fcntl.h
index 8bb1357684..c69869f1c4 100644
--- a/bits/fcntl.h
+++ b/bits/fcntl.h
@@ -16,10 +16,14 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_FCNTL_H
+#define _BITS_FCNTL_H 1
+
#ifndef _FCNTL_H
#error "Never use directly; include instead."
#endif
+#include
/* File access modes for `open' and `fcntl'. */
#define O_RDONLY 0 /* Open read-only. */
@@ -104,9 +108,6 @@
/* File descriptor flags used with F_GETFD and F_SETFD. */
#define FD_CLOEXEC 1 /* Close on exec. */
-
-#include
-
/* The structure describing an advisory lock. This is the type of the third
argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
struct flock
@@ -144,3 +145,5 @@ struct flock64
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+#endif
diff --git a/bits/sem.h b/bits/sem.h
index 02754c7e58..6eed74c12e 100644
--- a/bits/sem.h
+++ b/bits/sem.h
@@ -15,11 +15,14 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_SEM_H
+#define _BITS_SEM_H 1
+
#ifndef _SYS_SEM_H
# error "Never include directly; use instead."
#endif
-#include
+#include
/* Flags for `semop'. */
#define SEM_UNDO 0x1000 /* undo the operation on exit */
@@ -58,3 +61,5 @@ struct semid_ds
incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
one must define the union or not. */
#define _SEM_SEMUN_UNDEFINED 1
+
+#endif /* bits/sem.h */
diff --git a/sysdeps/gnu/bits/utmp.h b/bits/utmp.h
similarity index 83%
copy from sysdeps/gnu/bits/utmp.h
copy to bits/utmp.h
index 7357034cb6..3d593e0c0a 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/bits/utmp.h
@@ -16,13 +16,13 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_UTMP_H
+#define _BITS_UTMP_H 1
+
#ifndef _UTMP_H
# error "Never include directly; use instead."
#endif
-#include
-#include
-#include
#include
@@ -36,7 +36,7 @@
struct lastlog
{
#if __WORDSIZE_TIME64_COMPAT32
- int32_t ll_time;
+ __int32_t ll_time;
#else
__time_t ll_time;
#endif
@@ -68,23 +68,29 @@ struct utmp
__attribute_nonstring__; /* Hostname for remote login. */
struct exit_status ut_exit; /* Exit status of a process marked
as DEAD_PROCESS. */
+
/* The ut_session and ut_tv fields must be the same size when compiled
32- and 64-bit. This allows data files and shared memory to be
- shared between 32- and 64-bit applications. */
+ shared between 32- and 64-bit applications. Even on 64-bit systems,
+ struct timeval is not guaranteed to have both fields be 64 bits. */
#if __WORDSIZE_TIME64_COMPAT32
- int32_t ut_session; /* Session ID, used for windowing. */
+ __int32_t ut_session; /* Session ID, used for windowing. */
struct
{
- int32_t tv_sec; /* Seconds. */
- int32_t tv_usec; /* Microseconds. */
+ __int32_t tv_sec; /* Seconds. */
+ __int32_t tv_usec; /* Microseconds. */
} ut_tv; /* Time entry was made. */
#else
- long int ut_session; /* Session ID, used for windowing. */
- struct timeval ut_tv; /* Time entry was made. */
+ __int64_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ __int64_t tv_sec; /* Seconds. */
+ __int64_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
#endif
- int32_t ut_addr_v6[4]; /* Internet address of remote host. */
- char __glibc_reserved[20]; /* Reserved for future use. */
+ __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __glibc_reserved[20]; /* Reserved for future use. */
};
/* Backwards compatibility hacks. */
@@ -124,3 +130,5 @@ struct utmp
#define _HAVE_UT_ID 1
#define _HAVE_UT_TV 1
#define _HAVE_UT_HOST 1
+
+#endif /* bits/utmp.h */
diff --git a/sysdeps/gnu/bits/utmpx.h b/bits/utmpx.h
similarity index 82%
rename from sysdeps/gnu/bits/utmpx.h
rename to bits/utmpx.h
index 472a7d57d3..ac4a5323fd 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/bits/utmpx.h
@@ -16,22 +16,13 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_UTMPX_H
+#define _BITS_UTMPX_H 1
+
#ifndef _UTMPX_H
# error "Never include directly; use instead."
#endif
-#include
-#include
-#include
-
-
-#ifdef __USE_GNU
-# include
-# define _PATH_UTMPX _PATH_UTMP
-# define _PATH_WTMPX _PATH_WTMP
-#endif
-
-
#define __UT_LINESIZE 32
#define __UT_NAMESIZE 32
#define __UT_HOSTSIZE 256
@@ -55,7 +46,7 @@ struct __exit_status
struct utmpx
{
short int ut_type; /* Type of login. */
- __pid_t ut_pid; /* Process ID of login process. */
+ pid_t ut_pid; /* Process ID of login process. */
char ut_line[__UT_LINESIZE]; /* Devicename. */
char ut_id[4]; /* Inittab ID. */
char ut_user[__UT_NAMESIZE]; /* Username. */
@@ -63,9 +54,10 @@ struct utmpx
struct __exit_status ut_exit; /* Exit status of a process marked
as DEAD_PROCESS. */
-/* The fields ut_session and ut_tv must be the same size when compiled
- 32- and 64-bit. This allows files and shared memory to be shared
- between 32- and 64-bit applications. */
+/* The ut_session and ut_tv fields must be the same size when compiled
+ 32- and 64-bit. This allows data files and shared memory to be
+ shared between 32- and 64-bit applications. Even on 64-bit systems,
+ struct timeval is not guaranteed to have both fields be 64 bits. */
#if __WORDSIZE_TIME64_COMPAT32
__int32_t ut_session; /* Session ID, used for windowing. */
struct
@@ -74,9 +66,14 @@ struct utmpx
__int32_t tv_usec; /* Microseconds. */
} ut_tv; /* Time entry was made. */
#else
- long int ut_session; /* Session ID, used for windowing. */
- struct timeval ut_tv; /* Time entry was made. */
+ __int64_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ __int64_t tv_sec; /* Seconds. */
+ __int64_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
#endif
+
__int32_t ut_addr_v6[4]; /* Internet address of remote host. */
char __glibc_reserved[20]; /* Reserved for future use. */
};
@@ -100,3 +97,5 @@ struct utmpx
#ifdef __USE_GNU
# define ACCOUNTING 9 /* System accounting. */
#endif
+
+#endif /* bits/utmpx.h */
diff --git a/elf/link.h b/elf/link.h
index 7a463bc2bf..7871b9aef8 100644
--- a/elf/link.h
+++ b/elf/link.h
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
/* We use this macro to refer to ELF types independent of the native wordsize.
`ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
@@ -31,6 +30,7 @@
#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
#define _ElfW_1(e,w,t) e##w##t
+#include
#include /* Defines __ELF_NATIVE_CLASS. */
#include
diff --git a/gmon/sys/gmon.h b/gmon/sys/gmon.h
index b4cc3b043a..5d7de0fe9b 100644
--- a/gmon/sys/gmon.h
+++ b/gmon/sys/gmon.h
@@ -34,8 +34,6 @@
#include
-#include
-
/*
* See gmon_out.h for gmon.out format.
*/
diff --git a/gmon/sys/profil.h b/gmon/sys/profil.h
index ba99ac8634..1122590213 100644
--- a/gmon/sys/profil.h
+++ b/gmon/sys/profil.h
@@ -20,8 +20,8 @@
#include
-#include
-#include
+#include
+#include
/* This interface is intended to follow the sprofil() system calls as
described by the sprofil(2) man page of Irix v6.5, except that:
diff --git a/gmon/tst-sprofil.c b/gmon/tst-sprofil.c
index 3f7f909cba..53de7a624d 100644
--- a/gmon/tst-sprofil.c
+++ b/gmon/tst-sprofil.c
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
diff --git a/include/net/if.h b/include/net/if.h
index 6c4cbc96c3..2e7af05ed2 100644
--- a/include/net/if.h
+++ b/include/net/if.h
@@ -1,6 +1,6 @@
#ifndef _NET_IF_H
-# include_next
+#include
#ifndef _ISOMAC
libc_hidden_proto (if_nametoindex)
diff --git a/include/netinet/ether.h b/include/netinet/ether.h
index 8bfe7e03ad..a60aa27240 100644
--- a/include/netinet/ether.h
+++ b/include/netinet/ether.h
@@ -2,6 +2,7 @@
#include
# ifndef _ISOMAC
+# include
libc_hidden_proto (ether_aton_r)
libc_hidden_proto (ether_ntoa_r)
diff --git a/include/netinet/in_systm.h b/include/netinet/in_systm.h
new file mode 100644
index 0000000000..7634c9b5a0
--- /dev/null
+++ b/include/netinet/in_systm.h
@@ -0,0 +1 @@
+#include
diff --git a/include/netinet/ip.h b/include/netinet/ip.h
new file mode 100644
index 0000000000..da55733e90
--- /dev/null
+++ b/include/netinet/ip.h
@@ -0,0 +1 @@
+#include
diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
new file mode 100644
index 0000000000..edba529813
--- /dev/null
+++ b/include/netinet/tcp.h
@@ -0,0 +1 @@
+#include
diff --git a/include/sys/mtio.h b/include/sys/mtio.h
new file mode 100644
index 0000000000..f4861bda70
--- /dev/null
+++ b/include/sys/mtio.h
@@ -0,0 +1 @@
+#include
diff --git a/include/utmpx.h b/include/utmpx.h
new file mode 100644
index 0000000000..cfe9b7c054
--- /dev/null
+++ b/include/utmpx.h
@@ -0,0 +1 @@
+#include
diff --git a/inet/aliases.h b/inet/aliases.h
index 67828ca7b6..eebbbc46f2 100644
--- a/inet/aliases.h
+++ b/inet/aliases.h
@@ -19,9 +19,7 @@
#define _ALIASES_H 1
#include
-
-#include
-
+#include
__BEGIN_DECLS
diff --git a/inet/htonl.c b/inet/htonl.c
index 39acfa6557..bb6b4f5899 100644
--- a/inet/htonl.c
+++ b/inet/htonl.c
@@ -15,8 +15,9 @@
License along with the GNU C Library; if not, see
. */
-#include
#include
+#include
+#include
#undef htonl
#undef ntohl
diff --git a/inet/htons.c b/inet/htons.c
index 500ca50f49..2b22ca123c 100644
--- a/inet/htons.c
+++ b/inet/htons.c
@@ -16,6 +16,8 @@
. */
#include
+#include
+#include
#undef htons
#undef ntohs
diff --git a/sysdeps/generic/netinet/in_systm.h b/inet/netinet/in_systm.h
similarity index 97%
rename from sysdeps/generic/netinet/in_systm.h
rename to inet/netinet/in_systm.h
index 2b3c74281b..6964aca21a 100644
--- a/sysdeps/generic/netinet/in_systm.h
+++ b/inet/netinet/in_systm.h
@@ -19,8 +19,7 @@
#ifndef _NETINET_IN_SYSTM_H
#define _NETINET_IN_SYSTM_H 1
-#include
-#include
+#include
__BEGIN_DECLS
diff --git a/sysdeps/generic/netinet/ip.h b/inet/netinet/ip.h
similarity index 99%
rename from sysdeps/generic/netinet/ip.h
rename to inet/netinet/ip.h
index 13b03ff79f..35f61d1694 100644
--- a/sysdeps/generic/netinet/ip.h
+++ b/inet/netinet/ip.h
@@ -19,9 +19,10 @@
#define __NETINET_IP_H 1
#include
-#include
#include
+#include
+#include
__BEGIN_DECLS
diff --git a/sysdeps/gnu/netinet/tcp.h b/inet/netinet/tcp.h
similarity index 99%
rename from sysdeps/gnu/netinet/tcp.h
rename to inet/netinet/tcp.h
index 1a164a9649..7b07accce7 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/inet/netinet/tcp.h
@@ -85,9 +85,9 @@
#define TCP_REPAIR_OFF_NO_WP -1
#ifdef __USE_MISC
-# include
+# include
+# include
# include
-# include
typedef uint32_t tcp_seq;
/*
diff --git a/io/fts.h b/io/fts.h
index acfa260f07..0e43b35236 100644
--- a/io/fts.h
+++ b/io/fts.h
@@ -51,8 +51,11 @@
#define _FTS_H 1
#include
-#include
+#include
+#include
+#include
+#include
typedef struct {
struct _ftsent *fts_cur; /* current node */
diff --git a/io/ftw.h b/io/ftw.h
index 1ef67f7f3c..ea1d1ee48b 100644
--- a/io/ftw.h
+++ b/io/ftw.h
@@ -24,7 +24,6 @@
#include
-#include
#include
diff --git a/io/sys/sendfile.h b/io/sys/sendfile.h
index b21c0857be..d0e8a6777e 100644
--- a/io/sys/sendfile.h
+++ b/io/sys/sendfile.h
@@ -20,7 +20,11 @@
#define _SYS_SENDFILE_H 1
#include
-#include
+
+#include
+#include
+#include
+#include
__BEGIN_DECLS
diff --git a/login/Makefile b/login/Makefile
index 92535f0aec..e9bdd1ad15 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -23,12 +23,15 @@ subdir := login
include ../Makeconfig
-headers := utmp.h bits/utmp.h lastlog.h pty.h
+headers := utmp.h bits/utmp.h utmpx.h bits/utmpx.h lastlog.h pty.h
-routines := getlogin getlogin_r setlogin getlogin_r_chk \
- getutent getutent_r getutid getutline getutid_r getutline_r \
- utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \
- ptsname_r_chk
+routines := \
+ getlogin getlogin_r getlogin_r_chk setlogin \
+ getpt grantpt ptsname ptsname_r_chk unlockpt \
+ getutent getutent_r getutid getutid_r getutline getutline_r \
+ getutmp updwtmp utmp_file utmpname \
+ endutxent getutmpx getutxent getutxid getutxline pututxline \
+ setutxent updwtmpx utmpxname
CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"'
diff --git a/login/utmp.h b/login/utmp.h
index 168c159b7b..9c12e3c915 100644
--- a/login/utmp.h
+++ b/login/utmp.h
@@ -20,21 +20,26 @@
#include
-#include
-
-
-__BEGIN_DECLS
+/* utmp.h is not standardized; utmpx.h is, and is required to define
+ pid_t and struct timeval. It makes sense for utmp.h to be
+ consistent. */
+#include
+#include
+#include
+#include
+#include
/* Get system dependent values and data structures. */
#include
/* Compatibility names for the strings of the canonical file names. */
+#include
#define UTMP_FILE _PATH_UTMP
#define UTMP_FILENAME _PATH_UTMP
#define WTMP_FILE _PATH_WTMP
#define WTMP_FILENAME _PATH_WTMP
-
+__BEGIN_DECLS
/* Make FD be the controlling terminal, stdin, stdout, and stderr;
then close FD. Returns 0 on success, nonzero on error. */
diff --git a/sysdeps/gnu/utmpx.h b/login/utmpx.h
similarity index 94%
rename from sysdeps/gnu/utmpx.h
rename to login/utmpx.h
index 41c122d970..de18f58e9e 100644
--- a/sysdeps/gnu/utmpx.h
+++ b/login/utmpx.h
@@ -19,15 +19,22 @@
#define _UTMPX_H 1
#include
-#include
/* Required according to Unix98. */
+#include
#include
+#include
+#include
+#include
/* Get system dependent values and data structures. */
#include
#ifdef __USE_GNU
+# include
+# define _PATH_UTMPX _PATH_UTMP
+# define _PATH_WTMPX _PATH_WTMP
+
/* Compatibility names for the strings of the canonical file names. */
# define UTMPX_FILE _PATH_UTMPX
# define UTMPX_FILENAME _PATH_UTMPX
diff --git a/misc/Makefile b/misc/Makefile
index e6c73896cd..106ce57776 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -36,9 +36,9 @@ headers := \
bits/uio-ext.h bits/uio_lim.h bits/xopen_lim.h \
gnu/libc-version.h \
sys/auxv.h sys/cdefs.h sys/dir.h sys/file.h sys/ioctl.h \
- sys/mman.h sys/param.h sys/ptrace.h sys/queue.h sys/reboot.h \
- sys/select.h sys/swap.h sys/syscall.h sys/sysinfo.h \
- sys/syslog.h sys/sysmacros.h sys/uio.h sys/xattr.h
+ sys/mman.h sys/mtio.h sys/param.h sys/ptrace.h sys/queue.h \
+ sys/reboot.h sys/select.h sys/swap.h sys/syscall.h \
+ sys/sysinfo.h sys/syslog.h sys/sysmacros.h sys/uio.h sys/xattr.h
routines := brk sbrk sstk ioctl \
readv writev preadv preadv64 pwritev pwritev64 \
diff --git a/sysdeps/gnu/sys/mtio.h b/misc/sys/mtio.h
similarity index 99%
rename from sysdeps/gnu/sys/mtio.h
rename to misc/sys/mtio.h
index 0ce41c58df..1387b13fac 100644
--- a/sysdeps/gnu/sys/mtio.h
+++ b/misc/sys/mtio.h
@@ -21,11 +21,8 @@
#ifndef _SYS_MTIO_H
#define _SYS_MTIO_H 1
-/* Get necessary definitions from system and kernel headers. */
-#include
#include
-
/* Structure for MTIOCTOP - magnetic tape operation command. */
struct mtop
{
diff --git a/misc/sys/uio.h b/misc/sys/uio.h
index ec1ca4af82..40bedd079a 100644
--- a/misc/sys/uio.h
+++ b/misc/sys/uio.h
@@ -19,7 +19,10 @@
#define _SYS_UIO_H 1
#include
-#include
+
+#include
+#include
+#include
#include
#include
#ifdef __IOV_MAX
diff --git a/misc/sys/xattr.h b/misc/sys/xattr.h
index f1143f892c..03c7dec9aa 100644
--- a/misc/sys/xattr.h
+++ b/misc/sys/xattr.h
@@ -19,8 +19,9 @@
#define _SYS_XATTR_H 1
#include
-#include
+#include
+#include
__BEGIN_DECLS
diff --git a/nss/nss.h b/nss/nss.h
index 9d4f33e999..0be375259f 100644
--- a/nss/nss.h
+++ b/nss/nss.h
@@ -22,7 +22,7 @@
#define _NSS_H 1
#include
-#include
+#include
__BEGIN_DECLS
@@ -44,8 +44,8 @@ struct gaih_addrtuple
struct gaih_addrtuple *next;
char *name;
int family;
- uint32_t addr[4];
- uint32_t scopeid;
+ __uint32_t addr[4];
+ __uint32_t scopeid;
};
diff --git a/nss/tst-nss-test4.c b/nss/tst-nss-test4.c
index cf6ef46b01..14bea82cb6 100644
--- a/nss/tst-nss-test4.c
+++ b/nss/tst-nss-test4.c
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
diff --git a/posix/spawn.h b/posix/spawn.h
index 471dbea022..2dd75439cb 100644
--- a/posix/spawn.h
+++ b/posix/spawn.h
@@ -21,7 +21,10 @@
#include
#include
-#include
+
+#include
+#include
+#include
#include
diff --git a/resolv/bits/types/res_state.h b/resolv/bits/types/res_state.h
index 2544a627f6..81febe13b0 100644
--- a/resolv/bits/types/res_state.h
+++ b/resolv/bits/types/res_state.h
@@ -1,7 +1,7 @@
#ifndef __res_state_defined
#define __res_state_defined 1
-#include
+#include
#include
/* res_state: the global state used by the resolver stub. */
@@ -28,7 +28,7 @@ struct __res_state {
unsigned unused:23;
struct {
struct in_addr addr;
- uint32_t mask;
+ __uint32_t mask;
} sort_list[MAXRESOLVSORT];
/* 4 byte hole here on 64-bit architectures. */
void * __glibc_unused_qhook;
@@ -40,11 +40,11 @@ struct __res_state {
union {
char pad[52]; /* On an i386 this means 512b total. */
struct {
- uint16_t nscount;
- uint16_t nsmap[MAXNS];
+ __uint16_t nscount;
+ __uint16_t nsmap[MAXNS];
int nssocks[MAXNS];
- uint16_t nscount6;
- uint16_t nsinit;
+ __uint16_t nscount6;
+ __uint16_t nsinit;
struct sockaddr_in6 *nsaddrs[MAXNS];
#ifdef _LIBC
unsigned long long int __glibc_extension_index
diff --git a/rt/aio.h b/rt/aio.h
index d1b97bf0e4..a874e45ac9 100644
--- a/rt/aio.h
+++ b/rt/aio.h
@@ -23,7 +23,12 @@
#define _AIO_H 1
#include
-#include
+
+#include
+#include
+#include
+#include
+#include
#include
#include
#include
diff --git a/rt/mqueue.h b/rt/mqueue.h
index 308a52c1bc..dcc786d12d 100644
--- a/rt/mqueue.h
+++ b/rt/mqueue.h
@@ -19,13 +19,19 @@
#define _MQUEUE_H 1
#include
-#include
#include
+
+#include
+#include
#include
+#include
+#include
#include
+
/* Get the definition of mqd_t and struct mq_attr. */
#include
+
__BEGIN_DECLS
/* Establish connection between a process and a message queue NAME and
diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
index f456c98def..1ecb7c9823 100755
--- a/scripts/check-obsolete-constructs.py
+++ b/scripts/check-obsolete-constructs.py
@@ -515,16 +515,15 @@ HEADER_ALLOWED_INCLUDES = {
# mqueue.h -> fcntl.h
# sched.h -> time.h
# spawn.h -> sched.h
- "aio.h": [ "sys/types.h" ],
- "ftw.h": [ "sys/stat.h", "sys/types.h" ],
+ "ftw.h": [ "sys/stat.h" ],
"langinfo.h": [ "nl_types.h" ],
- "mqueue.h": [ "fcntl.h", "sys/types.h" ],
+ "mqueue.h": [ "fcntl.h" ],
"pthread.h": [ "sched.h", "time.h" ],
"regex.h": [ "limits.h", "sys/types.h" ],
"sched.h": [ "time.h" ],
- "semaphore.h": [ "sys/types.h" ],
- "spawn.h": [ "sched.h", "sys/types.h" ],
+ "spawn.h": [ "sched.h" ],
"termios.h": [ "sys/ttydefaults.h" ],
+ "utmpx.h": [ "paths.h" ],
# POSIX sys/ headers
# mandated: sys/msg.h -> sys/ipc.h
@@ -538,77 +537,54 @@ HEADER_ALLOWED_INCLUDES = {
# necessary for backward compatibility with BSD
"sys/types.h": [ "endian.h" ],
- "sys/uio.h": [ "sys/types.h" ],
-
# POSIX networking headers
# allowed: netdb.h -> netinet/in.h
# arpa/inet.h -> netinet/in.h
"netdb.h": [ "netinet/in.h", "rpc/netdb.h" ],
"arpa/inet.h": [ "netinet/in.h" ],
- "net/if.h": [ "sys/socket.h", "sys/types.h" ],
+ "net/if.h": [ "sys/socket.h" ],
"netinet/in.h": [ "sys/socket.h" ],
- "netinet/tcp.h": [ "stdint.h", "sys/socket.h",
- "sys/types.h" ],
+ "netinet/tcp.h": [ "sys/socket.h" ],
# Nonstandardized top-level headers
- "aliases.h": [ "sys/types.h" ],
"argp.h": [ "ctype.h", "errno.h", "getopt.h",
"limits.h", "stdio.h" ],
"argz.h": [ "errno.h", "string.h" ],
"elf.h": [ "stdint.h" ],
"envz.h": [ "argz.h", "errno.h" ],
- "fts.h": [ "sys/types.h" ],
"gshadow.h": [ "paths.h" ],
"ieee754.h": [ "float.h" ],
"lastlog.h": [ "utmp.h" ],
"libintl.h": [ "locale.h" ],
- "link.h": [ "dlfcn.h", "elf.h", "sys/types.h" ],
+ "link.h": [ "dlfcn.h", "elf.h" ],
"mntent.h": [ "paths.h" ],
- "nss.h": [ "stdint.h" ],
"obstack.h": [ "stddef.h", "string.h" ],
"proc_service.h": [ "sys/procfs.h" ],
"pty.h": [ "sys/ioctl.h", "termios.h" ],
"sgtty.h": [ "sys/ioctl.h" ],
"shadow.h": [ "paths.h" ],
"stdio_ext.h": [ "stdio.h" ],
- "thread_db.h": [ "pthread.h", "stdint.h", "sys/procfs.h",
- "sys/types.h" ],
+ "thread_db.h": [ "pthread.h", "stdint.h", "sys/procfs.h" ],
"ucontext.h": [ "sys/ucontext.h" ],
- "utmp.h": [ "sys/types.h" ],
- "utmpx.h": [ "sys/time.h" ],
+ "utmp.h": [ "paths.h" ],
"values.h": [ "float.h", "limits.h" ],
# Nonstandardized sys/ headers
- "sys/acct.h": [ "endian.h", "stdint.h", "sys/types.h" ],
"sys/auxv.h": [ "elf.h" ],
"sys/elf.h": [ "sys/procfs.h" ],
- "sys/epoll.h": [ "stdint.h", "sys/types.h" ],
- "sys/eventfd.h": [ "stdint.h" ],
- "sys/fanotify.h": [ "stdint.h" ],
"sys/file.h": [ "fcntl.h" ],
- "sys/fsuid.h": [ "sys/types.h" ],
- "sys/gmon.h": [ "sys/types.h" ],
- "sys/inotify.h": [ "stdint.h" ],
"sys/ioctl.h": [ "sys/ttydefaults.h" ],
"sys/mount.h": [ "sys/ioctl.h" ],
- "sys/mtio.h": [ "sys/ioctl.h", "sys/types.h" ],
+ "sys/mtio.h": [ "sys/ioctl.h" ],
"sys/param.h": [ "endian.h", "limits.h", "sys/types.h" ],
- "sys/platform/ppc.h": [ "stdint.h" ],
- "sys/procfs.h": [ "sys/time.h", "sys/types.h",
- "sys/user.h" ],
- "sys/profil.h": [ "sys/time.h", "sys/types.h" ],
+ "sys/procfs.h": [ "sys/ucontext.h", "sys/user.h" ],
"sys/ptrace.h": [ "sys/ucontext.h" ],
- "sys/quota.h": [ "sys/types.h" ],
- "sys/random.h": [ "sys/types.h" ],
- "sys/raw.h": [ "stdint.h", "sys/ioctl.h" ],
- "sys/sendfile.h": [ "sys/types.h" ],
- "sys/signalfd.h": [ "stdint.h" ],
+ "sys/raw.h": [ "sys/ioctl.h" ],
"sys/socketvar.h": [ "sys/socket.h" ],
"sys/timerfd.h": [ "time.h" ],
"sys/ttychars.h": [ "sys/ttydefaults.h" ],
"sys/ucontext.h": [ "sys/procfs.h" ],
"sys/vfs.h": [ "sys/statfs.h" ],
- "sys/xattr.h": [ "sys/types.h" ],
# Nonstandardized headers that do nothing but include some other
# header(s). These exist for compatibility with old systems where
@@ -656,8 +632,7 @@ HEADER_ALLOWED_INCLUDES = {
"netinet/if_fddi.h": [ "stdint.h", "sys/types.h" ],
"netinet/if_tr.h": [ "stdint.h", "sys/types.h" ],
"netinet/igmp.h": [ "netinet/in.h", "sys/types.h" ],
- "netinet/in_systm.h": [ "stdint.h", "sys/types.h" ],
- "netinet/ip.h": [ "netinet/in.h", "sys/types.h" ],
+ "netinet/ip.h": [ "netinet/in.h" ],
"netinet/ip6.h": [ "inttypes.h", "netinet/in.h" ],
"netinet/ip_icmp.h": [ "netinet/in.h", "netinet/ip.h",
"stdint.h", "sys/types.h" ],
@@ -675,14 +650,8 @@ HEADER_ALLOWED_INCLUDES = {
"features.h": [ "gnu/stubs.h", "stdc-predef.h",
"sys/cdefs.h" ],
- "bits/fcntl.h": [ "sys/types.h" ],
- "bits/ipc.h": [ "sys/types.h" ],
"bits/procfs.h": [ "signal.h", "sys/ucontext.h" ],
- "bits/sem.h": [ "sys/types.h" ],
- "bits/socket.h": [ "sys/types.h" ],
- "bits/types/res_state.h": [ "netinet/in.h", "sys/types.h" ],
- "bits/utmp.h": [ "paths.h", "sys/time.h", "sys/types.h" ],
- "bits/utmpx.h": [ "paths.h", "sys/time.h" ],
+ "bits/types/res_state.h": [ "netinet/in.h" ],
"bits/types/__va_list.h": [ "stdarg.h" ],
"bits/types/ptrdiff_t.h": [ "stddef.h" ],
@@ -730,7 +699,8 @@ SYSDEP_ALLOWED_INCLUDES = {
"bits/ioctls.h": [ "asm/ioctls.h", "linux/sockios.h" ],
"bits/local_lim.h": [ "linux/limits.h" ],
"bits/param.h": [ "linux/limits.h", "linux/param.h" ],
- "bits/procfs.h": [ "asm/ptrace.h" ],
+ "bits/procfs.h": [ "asm/elf.h", "asm/ptrace.h" ],
+ "bits/procfs-prregset.h": [ "sys/ucontext.h" ],
"bits/sigcontext.h": [ "asm/sigcontext.h" ],
"bits/socket.h": [ "asm/socket.h" ],
},
diff --git a/sysdeps/gnu/net/if.h b/socket/net/if.h
similarity index 98%
rename from sysdeps/gnu/net/if.h
rename to socket/net/if.h
index e94ed67c21..b2fdbf7be0 100644
--- a/sysdeps/gnu/net/if.h
+++ b/socket/net/if.h
@@ -21,12 +21,6 @@
#include
-#ifdef __USE_MISC
-# include
-# include
-#endif
-
-
/* Length of interface name. */
#define IF_NAMESIZE 16
@@ -38,6 +32,8 @@ struct if_nameindex
#ifdef __USE_MISC
+# include /* for struct sockaddr */
+
/* Standard interface flags. */
enum
{
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index ce793dc3e2..9770d90d2a 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -23,7 +23,10 @@
__BEGIN_DECLS
+#include
#include
+#include
+#include
#include
/* This operating system-specific header file defines the SOCK_*, PF_*,
diff --git a/stdlib/sys/random.h b/stdlib/sys/random.h
index 2297edf2f2..1da7f6bea0 100644
--- a/stdlib/sys/random.h
+++ b/stdlib/sys/random.h
@@ -20,7 +20,9 @@
#define _SYS_RANDOM_H 1
#include
-#include
+
+#include
+#include
/* Flags for use with getrandom. */
#define GRND_NONBLOCK 0x01
diff --git a/sysdeps/generic/net/if.h b/sysdeps/generic/net/if.h
deleted file mode 100644
index 4af66511e7..0000000000
diff --git a/sysdeps/generic/netinet/tcp.h b/sysdeps/generic/netinet/tcp.h
deleted file mode 100644
index 3b59e949d8..0000000000
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index a03d40e4ca..fdfbfc45d8 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -58,24 +58,12 @@ $(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
$(objpfx)errlist$o): $(objpfx)errlist-compat.h
endif
-ifeq ($(subdir),login)
-sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
- pututxline utmpxname updwtmpx getutmpx getutmp
-
-sysdep_headers += utmpx.h bits/utmpx.h
-endif
-
ifeq ($(subdir),inet)
sysdep_headers += netinet/udp.h netinet/ip_icmp.h
endif
-ifeq ($(subdir),misc)
-sysdep_headers += sys/mtio.h
-endif
-
-
ifeq ($(subdir),csu)
routines += unwind-resume
shared-only-routines += unwind-resume
diff --git a/sysdeps/gnu/bits/sem.h b/sysdeps/gnu/bits/sem.h
index 12ec4e61b1..2eeb12af0c 100644
--- a/sysdeps/gnu/bits/sem.h
+++ b/sysdeps/gnu/bits/sem.h
@@ -15,11 +15,14 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_SEM_H
+#define _BITS_SEM_H 1
+
#ifndef _SYS_SEM_H
# error "Never include directly; use instead."
#endif
-#include
+#include
/* Flags for `semop'. */
#define SEM_UNDO 0x1000 /* undo the operation on exit */
@@ -85,3 +88,5 @@ struct seminfo
};
#endif /* __USE_MISC */
+
+#endif /* bits/sem.h */
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index 9da4f8a145..b666a71ac2 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/bits/fcntl.h
@@ -16,11 +16,14 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_FCNTL_H
+#define _BITS_FCNTL_H 1
+
#ifndef _FCNTL_H
# error "Never use directly; include instead."
#endif
-#include
+#include
/* File access modes. These are understood by io servers; they can be
passed in `dir_lookup', and are returned by `io_get_openmodes'.
@@ -180,13 +183,9 @@
# define F_DUPFD_CLOEXEC 1030 /* Duplicate, set FD_CLOEXEC on new one. */
#endif
-
/* File descriptor flags used with F_GETFD and F_SETFD. */
#define FD_CLOEXEC 1 /* Close on exec. */
-
-#include
-
/* The structure describing an advisory lock. This is the type of the third
argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
struct flock
@@ -228,3 +227,5 @@ struct flock64
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
+
+#endif /* bits/fcntl.h */
diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
index ad590af3f6..77498ca43e 100644
--- a/sysdeps/mach/hurd/bits/socket.h
+++ b/sysdeps/mach/hurd/bits/socket.h
@@ -25,7 +25,7 @@
#endif
-#include
+#include
#include
#include
#include
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index bf62a5fc67..88747c684a 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -20,69 +20,34 @@ ifeq ($(subdir),conform)
conformtest-xfail-conds += i386-gnu
# For bug 23088
-test-xfail-POSIX/fcntl.h/conform = yes
test-xfail-POSIX/signal.h/conform = yes
-test-xfail-POSIX/semaphore.h/conform = yes
test-xfail-POSIX/regex.h/conform = yes
test-xfail-POSIX/aio.h/conform = yes
test-xfail-POSIX/mqueue.h/conform = yes
test-xfail-POSIX/sys/types.h/conform = yes
-test-xfail-UNIX98/fcntl.h/conform = yes
-test-xfail-UNIX98/netdb.h/conform = yes
test-xfail-UNIX98/signal.h/conform = yes
-test-xfail-UNIX98/semaphore.h/conform = yes
test-xfail-UNIX98/regex.h/conform = yes
test-xfail-UNIX98/aio.h/conform = yes
-test-xfail-UNIX98/ftw.h/conform = yes
test-xfail-UNIX98/mqueue.h/conform = yes
-test-xfail-UNIX98/netinet/in.h/conform = yes
-test-xfail-UNIX98/sys/sem.h/conform = yes
-test-xfail-UNIX98/sys/uio.h/conform = yes
-test-xfail-UNIX98/sys/socket.h/conform = yes
test-xfail-UNIX98/sys/types.h/conform = yes
test-xfail-UNIX98/stdlib.h/conform = yes
-test-xfail-UNIX98/arpa/inet.h/conform = yes
-test-xfail-POSIX2008/fcntl.h/conform = yes
-test-xfail-POSIX2008/netdb.h/conform = yes
test-xfail-POSIX2008/signal.h/conform = yes
-test-xfail-POSIX2008/semaphore.h/conform = yes
test-xfail-POSIX2008/regex.h/conform = yes
test-xfail-POSIX2008/aio.h/conform = yes
test-xfail-POSIX2008/mqueue.h/conform = yes
-test-xfail-POSIX2008/netinet/in.h/conform = yes
-test-xfail-POSIX2008/sys/socket.h/conform = yes
test-xfail-POSIX2008/sys/types.h/conform = yes
-test-xfail-POSIX2008/arpa/inet.h/conform = yes
-test-xfail-XOPEN2K/fcntl.h/conform = yes
-test-xfail-XOPEN2K/netdb.h/conform = yes
test-xfail-XOPEN2K/signal.h/conform = yes
-test-xfail-XOPEN2K/semaphore.h/conform = yes
test-xfail-XOPEN2K/regex.h/conform = yes
test-xfail-XOPEN2K/aio.h/conform = yes
-test-xfail-XOPEN2K/ftw.h/conform = yes
test-xfail-XOPEN2K/mqueue.h/conform = yes
-test-xfail-XOPEN2K/netinet/in.h/conform = yes
-test-xfail-XOPEN2K/sys/sem.h/conform = yes
-test-xfail-XOPEN2K/sys/uio.h/conform = yes
-test-xfail-XOPEN2K/sys/socket.h/conform = yes
test-xfail-XOPEN2K/sys/types.h/conform = yes
test-xfail-XOPEN2K/stdlib.h/conform = yes
-test-xfail-XOPEN2K/arpa/inet.h/conform = yes
-test-xfail-XOPEN2K8/fcntl.h/conform = yes
-test-xfail-XOPEN2K8/netdb.h/conform = yes
test-xfail-XOPEN2K8/signal.h/conform = yes
-test-xfail-XOPEN2K8/semaphore.h/conform = yes
test-xfail-XOPEN2K8/regex.h/conform = yes
test-xfail-XOPEN2K8/aio.h/conform = yes
-test-xfail-XOPEN2K8/ftw.h/conform = yes
test-xfail-XOPEN2K8/mqueue.h/conform = yes
-test-xfail-XOPEN2K8/netinet/in.h/conform = yes
-test-xfail-XOPEN2K8/sys/sem.h/conform = yes
-test-xfail-XOPEN2K8/sys/uio.h/conform = yes
-test-xfail-XOPEN2K8/sys/socket.h/conform = yes
test-xfail-XOPEN2K8/sys/types.h/conform = yes
test-xfail-XOPEN2K8/stdlib.h/conform = yes
-test-xfail-XOPEN2K8/arpa/inet.h/conform = yes
# For bug 23819
test-xfail-ISO11/threads.h/linknamespace = yes
diff --git a/sysdeps/mach/hurd/sendfile.c b/sysdeps/mach/hurd/sendfile.c
index 4857396cf7..dbb1ab8730 100644
--- a/sysdeps/mach/hurd/sendfile.c
+++ b/sysdeps/mach/hurd/sendfile.c
@@ -17,6 +17,7 @@
. */
#include
+#include
#include
/* Send COUNT bytes from file associated with IN_FD starting at OFFSET to
diff --git a/sysdeps/nptl/proc_service.h b/sysdeps/nptl/proc_service.h
index 4aa52c6390..600cbd132e 100644
--- a/sysdeps/nptl/proc_service.h
+++ b/sysdeps/nptl/proc_service.h
@@ -22,6 +22,9 @@
/* The definitions in this file must correspond to those in the debugger. */
#include
+#include
+#include
+
__BEGIN_DECLS
/* Functions in this interface return one of these status codes. */
diff --git a/sysdeps/nptl/sys/procfs.h b/sysdeps/nptl/sys/procfs.h
index 6ade66dfb6..0f886746e2 100644
--- a/sysdeps/nptl/sys/procfs.h
+++ b/sysdeps/nptl/sys/procfs.h
@@ -19,7 +19,8 @@
#ifndef _SYS_PROCFS_H
#define _SYS_PROCFS_H 1
-#include
+#include
+#include
/* The rest of this file provides the types for emulation of the
Solaris interfaces that should be implemented by
diff --git a/sysdeps/nptl/thread_db.h b/sysdeps/nptl/thread_db.h
index 4d949b0c37..3d6cb3a891 100644
--- a/sysdeps/nptl/thread_db.h
+++ b/sysdeps/nptl/thread_db.h
@@ -24,7 +24,6 @@
with the goal to share the same code in the debugger. */
#include
#include
-#include
#include
#include
diff --git a/sysdeps/posix/dl-fileid.h b/sysdeps/posix/dl-fileid.h
index 1ed7c2c57b..6a5dfc7446 100644
--- a/sysdeps/posix/dl-fileid.h
+++ b/sysdeps/posix/dl-fileid.h
@@ -23,8 +23,8 @@
a unique identifier for a file. */
struct r_file_id
{
- dev_t dev;
- ino64_t ino;
+ __dev_t dev;
+ __ino64_t ino;
};
/* Sample FD to fill in *ID. Returns true on success.
diff --git a/sysdeps/powerpc/sys/platform/ppc.h b/sysdeps/powerpc/sys/platform/ppc.h
index 40ac0a5245..fe4d445dd4 100644
--- a/sysdeps/powerpc/sys/platform/ppc.h
+++ b/sysdeps/powerpc/sys/platform/ppc.h
@@ -20,24 +20,24 @@
#define _SYS_PLATFORM_PPC_H 1
#include
-#include
+#include
#include
/* Read the Time Base Register. */
-static __inline__ uint64_t
+static __inline__ __uint64_t
__ppc_get_timebase (void)
{
#if __GNUC_PREREQ (4, 8)
return __builtin_ppc_get_timebase ();
#else
# ifdef __powerpc64__
- uint64_t __tb;
+ __uint64_t __tb;
/* "volatile" is necessary here, because the user expects this assembly
isn't moved after an optimization. */
__asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
return __tb;
# else /* not __powerpc64__ */
- uint32_t __tbu, __tbl, __tmp; \
+ __uint32_t __tbu, __tbl, __tmp;
__asm__ volatile ("0:\n\t"
"mftbu %0\n\t"
"mftbl %1\n\t"
@@ -45,7 +45,7 @@ __ppc_get_timebase (void)
"cmpw %0, %2\n\t"
"bne- 0b"
: "=r" (__tbu), "=r" (__tbl), "=r" (__tmp));
- return (((uint64_t) __tbu << 32) | __tbl);
+ return (((__uint64_t) __tbu << 32) | __tbl);
# endif /* not __powerpc64__ */
#endif
}
diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h
index 87c054392c..075b0be175 100644
--- a/sysdeps/pthread/semaphore.h
+++ b/sysdeps/pthread/semaphore.h
@@ -19,7 +19,7 @@
#define _SEMAPHORE_H 1
#include
-#include
+
#ifdef __USE_XOPEN2K
# include
#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h b/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h
index ea91de06bd..fec2f6a266 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h
@@ -17,19 +17,28 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
+#include
+
/* Type for a general-purpose register. */
typedef __uint64_t elf_greg_t;
/* And the whole bunch of them. We could have used `struct
- pt_regs' directly in the typedef, but tradition says that
+ user_regs_struct' directly in the typedef, but tradition says that
the register set is an array, which does have some peculiar
- semantics, so leave it that way. */
+ semantics, so leave it that way.
+
+ struct user_regs_struct is defined in sys/user.h. */
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */
typedef struct user_fpsimd_struct elf_fpregset_t;
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
index 3bf1853cd8..41dd9c51c4 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
@@ -15,6 +15,9 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
#ifndef _SYS_EPOLL_H
# error "Never use directly; include instead."
#endif
@@ -25,3 +28,5 @@ enum
EPOLL_CLOEXEC = 010000000
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
};
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h b/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
index a5fffc0005..58b015fbc6 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
@@ -17,9 +17,18 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_PROCFS_PRREGSET_H
+#define _BITS_PROCFS_PRREGSET_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
+/* For gregset_t and fpregset_t. FIXME: sys/procfs.h should not
+ expose all of sys/ucontext.h. */
+#include
+
typedef gregset_t __prgregset_t;
typedef fpregset_t __prfpregset_t;
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/procfs.h b/sysdeps/unix/sysv/linux/alpha/bits/procfs.h
index d0fd280821..f04a453bd5 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/procfs.h
@@ -16,13 +16,13 @@
License along with the GNU C Library. If not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
-#include
-#include
-
/*
* The OSF/1 version of makes gregset_t 46 entries long.
* I have no idea why that is so. For now, we just leave it at 33
@@ -36,3 +36,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
typedef double elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
index 95e5b86e2f..98c92edc0d 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
@@ -16,8 +16,8 @@
. */
#ifndef _SYS_ACCT_H
-
#define _SYS_ACCT_H 1
+
#include
#include
diff --git a/sysdeps/unix/sysv/linux/arm/bits/procfs.h b/sysdeps/unix/sysv/linux/arm/bits/procfs.h
index f168b3af20..333fff661b 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/procfs.h
@@ -16,6 +16,9 @@
License along with the GNU C Library. If not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
@@ -26,9 +29,13 @@ typedef unsigned long elf_greg_t;
/* And the whole bunch of them. We could have used `struct
user_regs' directly in the typedef, but tradition says that
the register set is an array, which does have some peculiar
- semantics, so leave it that way. */
+ semantics, so leave it that way.
+
+ struct user_regs is defined in sys/user.h. */
#define ELF_NGREG (sizeof (struct user_regs) / sizeof (elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */
typedef struct user_fpregs elf_fpregset_t;
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/bits/epoll.h b/sysdeps/unix/sysv/linux/bits/epoll.h
index eaba990c23..a00f3d9431 100644
--- a/sysdeps/unix/sysv/linux/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/bits/epoll.h
@@ -15,6 +15,9 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
#ifndef _SYS_EPOLL_H
# error "Never use directly; include instead."
#endif
@@ -25,3 +28,5 @@ enum
EPOLL_CLOEXEC = 02000000
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
};
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h
index a216459010..68600e3917 100644
--- a/sysdeps/unix/sysv/linux/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/bits/sem.h
@@ -15,11 +15,14 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_SEM_H
+#define _BITS_SEM_H 1
+
#ifndef _SYS_SEM_H
# error "Never include directly; use instead."
#endif
-#include
+#include
#include
/* Flags for `semop'. */
@@ -95,3 +98,5 @@ struct seminfo
};
#endif /* __USE_MISC */
+
+#endif /* bits/sem.h */
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 19e664842f..ef3d6f9fc5 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -24,7 +24,7 @@
#endif
-#include
+#include
#include
#include
@@ -337,9 +337,9 @@ enum
/* User visible structure for SCM_CREDENTIALS message */
struct ucred
{
- pid_t pid; /* PID of sending process. */
- uid_t uid; /* UID of sending process. */
- gid_t gid; /* GID of sending process. */
+ __pid_t pid; /* PID of sending process. */
+ __uid_t uid; /* UID of sending process. */
+ __gid_t gid; /* GID of sending process. */
};
#endif
diff --git a/sysdeps/unix/sysv/linux/bits/uio-ext.h b/sysdeps/unix/sysv/linux/bits/uio-ext.h
index c4ea63df0b..a39080691b 100644
--- a/sysdeps/unix/sysv/linux/bits/uio-ext.h
+++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h
@@ -26,7 +26,7 @@
__BEGIN_DECLS
/* Read from another process' address space. */
-extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
+extern ssize_t process_vm_readv (__pid_t __pid, const struct iovec *__lvec,
unsigned long int __liovcnt,
const struct iovec *__rvec,
unsigned long int __riovcnt,
@@ -34,7 +34,7 @@ extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
__THROW;
/* Write to another process' address space. */
-extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
+extern ssize_t process_vm_writev (__pid_t __pid, const struct iovec *__lvec,
unsigned long int __liovcnt,
const struct iovec *__rvec,
unsigned long int __riovcnt,
diff --git a/sysdeps/unix/sysv/linux/csky/bits/procfs.h b/sysdeps/unix/sysv/linux/csky/bits/procfs.h
index 4ec0c5e759..97982b65bd 100644
--- a/sysdeps/unix/sysv/linux/csky/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/csky/bits/procfs.h
@@ -16,6 +16,9 @@
License along with the GNU C Library. If not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
@@ -35,3 +38,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
#define ELF_NFPREG (sizeof (struct user_fp) / sizeof (elf_fpreg_t))
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
index 156bda0f3c..77722144f0 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
@@ -15,6 +15,9 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
#ifndef _SYS_EPOLL_H
# error "Never use directly; include instead."
#endif
@@ -25,3 +28,5 @@ enum
EPOLL_CLOEXEC = 010000000
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
};
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/procfs.h b/sysdeps/unix/sysv/linux/hppa/bits/procfs.h
index 9d57472b5e..5bbdb2bc2e 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/procfs.h
@@ -16,6 +16,9 @@
License along with the GNU C Library. If not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
@@ -28,3 +31,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
#define ELF_NFPREG 32
typedef double elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/ipc.h b/sysdeps/unix/sysv/linux/ia64/bits/ipc.h
index 6f9705e28a..a6fbabec64 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/ipc.h
@@ -20,7 +20,7 @@
# error "Never use directly; include instead."
#endif
-#include
+#include
/* Mode bits for `msgget', `semget', and `shmget'. */
#define IPC_CREAT 01000 /* Create key if key does not exist. */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/procfs.h b/sysdeps/unix/sysv/linux/ia64/bits/procfs.h
index 8918975e1d..754e9690c9 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/procfs.h
@@ -16,11 +16,15 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
-#include
+/* For struct __ia64_fpreg. FIXME: sys/procfs.h should not expose all
+ of sys/ucontext.h. */
#include
#include
@@ -39,3 +43,5 @@ typedef elf_greg_t greg_t;
typedef elf_gregset_t gregset_t;
typedef elf_fpregset_t fpregset_t;
#define NGREG ELF_NGREG
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/procfs.h b/sysdeps/unix/sysv/linux/m68k/bits/procfs.h
index 4a9d4aa3cc..401ac2354a 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/procfs.h
@@ -16,6 +16,9 @@
License along with the GNU C Library. If not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
@@ -26,9 +29,13 @@ typedef unsigned long elf_greg_t;
/* And the whole bunch of them. We could have used `struct
user_regs_struct' directly in the typedef, but tradition says that
the register set is an array, which does have some peculiar
- semantics, so leave it that way. */
+ semantics, so leave it that way.
+
+ struct user_regs_struct is defined by sys/user.h. */
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */
typedef struct user_m68kfp_struct elf_fpregset_t;
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h b/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h
index 7da4b7385b..0f425272a3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h
+++ b/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h
@@ -17,6 +17,9 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
#ifndef _SYS_PROCFS_H
# error "Never include directly; use instead."
#endif
@@ -27,9 +30,13 @@ typedef unsigned long elf_greg_t;
/* And the whole bunch of them. We could have used `struct
user_regs_struct' directly in the typedef, but tradition says that
the register set is an array, which does have some peculiar
- semantics, so leave it that way. */
+ semantics, so leave it that way.
+
+ struct user_regs_struct is defined by sys/user.h. */
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */
typedef struct user_fpregs_struct elf_fpregset_t;
+
+#endif /* bits/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/microblaze/sys/user.h b/sysdeps/unix/sysv/linux/microblaze/sys/user.h
index baf6a28247..e6542ecd1b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sys/user.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sys/user.h
@@ -17,7 +17,9 @@
. */
#ifndef _SYS_USER_H
-# define _SYS_USER_H 1
+#define _SYS_USER_H 1
+
+#include
#include
diff --git a/sysdeps/unix/sysv/linux/mips/bits/epoll.h b/sysdeps/unix/sysv/linux/mips/bits/epoll.h
index eaba990c23..a00f3d9431 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/epoll.h
@@ -15,6 +15,9 @@
License along with the GNU C Library; if not, see
. */
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
#ifndef _SYS_EPOLL_H
# error "Never use directly; include