]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don’t include sys/types.h or stdint.h from most public headers.
authorZack Weinberg <zackw@panix.com>
Tue, 21 May 2019 23:05:39 +0000 (19:05 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 8 Jan 2020 19:15:36 +0000 (14:15 -0500)
Many public headers include sys/types.h and/or stdint.h when they only
need and/or are supposed to define a small number of types from that
header.  This patch changes as many of them as practical to include
only the single-type headers for the types they are actually specified
to define, and use the impl-namespace aliases for any types they need
but are not specified to define.  In most cases, where a header has
historically used uintN_t types, I changed it to use __uintN_t types;
in a few cases I chose to have it continue to define the complete set
of those types (using <bits/stdint-uintn.h>).

After this patch, the public headers that still include sys/types.h are:
stdlib.h and sys/param.h, where removal would risk breaking far too much;
the inclusion of sys/types.h; regex.h, which is taken verbatim from
gnulib and can't include features.h directly (I'm open to better ideas);
sys/bitypes.h, which is an alternative name for sys/types.h; and
the networking headers, which will be dealt with separately.  The headers
that still include stdint.h are: inttypes.h, as required by ISO C;
elf.h and thread_db.h, see discussion of debugger interface headers below;
and, again, the networking headers will be dealt with separately.

While I was at it, I moved headers out of sysdeps where possible: If
we have only a sysdeps/generic/something.h or sysdeps/gnu/something.h,
no other sysdeps variants, it is not really system-dependent and can
be moved to the directory that installs it.  If we have both
sysdeps/generic/ and gnu/something.h, the generic version is never
used (since we support only GNUish systems these days) and can be
deleted, and the gnu-version can be moved to the directory that
installs it.  If the only copy of a bits header is in the
top-level bits directory, it is not system-dependent.

For utmp.h and utmpx.h, I think we might be able to fold their
respective bits headers into the primary headers and make them not
system-dependent at all.  The remaining variation is between
s390*-*-linux* and everything else, and it appears to me that the s390
versions of the bits headers are actually the headers that everyone
should be using.  The only difference is that the s390 headers
unconditionally use 64-bit quantities for lastlog.ll_time,
utmp{,x}.ut_tv, and utmp{,x}.ut_session, whereas the generic headers
use either 64- or 32-bit quantities depending on
__WORDSIZE_TIME64_COMPAT32.  I could be wrong, but I don’t think it
makes sense for programs with 64-bit and 32-bit time_t to have
different ideas of the layout of a structures that are copied directly
to and from a shared file on disk.  But fixing that doesn’t belong in
this patch series.

The conform tests expect utmpx.h to define time_t and suseconds_t.
These are the public names for the types of the fields of struct
timeval, and utmpx.h is required to define struct timeval, so this is
a reasonable expectation even though POSIX doesn't _explicitly_ say
it's also required to define time_t and suseconds_t.  utmp.h is not a
standard header but it makes sense for it to be as consistent with
utmpx.h as possible, especially in our implementation where
/var/log/utmp and /var/log/utmpx have the same format.

I thought I was going to need to change all of the arch-specific
bits/epoll.h headers as well as sys/epoll.h, but it turned out not to
be necessary.  I still took the opportunity to give them all multiple
inclusion guards.

I suspect we do not need as many copies of bits/fcntl.h and bits/sem.h
as we have, but that’s complicated enough that it deserves its own patchset.

The debugger interface headers are a mess and I only have so much
patience for them.  This does the bare minimum required for
thread_db.h, sys/procfs.h, and sys/user.h, which are at least
nominally cross-platform interfaces, to avoid including sys/types.h,
sys/time.h, and/or signal.h.  Exposure of sys/ucontext.h is reduced
but not eliminated.  Cross-architecture consistency should be improved.
It would be desirable to stop including stdint.h from elf.h and
thread_db.h as well, but that would involve touching dozens more
bits headers and I ran out of patience.

Git does not understand “remove file X and then rename file Y over the
top of it” very well, so the diff looks bigger than it should.

This is another partial fix for Hurd-specific bug 23088.  The headers
that are still affected by that bug are aio.h, mqueue.h, regex.h,
signal.h, stdlib.h, and sys/types.h.

* io/ftw.h: Don't include sys/types.h.
* misc/sys/uio.h: Don't include sys/types.h.
Include bits/types.h, bits/types/size_t.h, and bits/types/ssize_t.h.
* posix/spawn.h: Don't include sys/types.h.
Include bits/types.h, bits/types/mode_t.h, and bits/types/pid_t.h.
* rt/aio.h: Don't include sys/types.h.
Include bits/types.h, bits/pthreadtypes.h,
bits/types/size_t.h, and bits/types/ssize_t.h.
* sysdeps/pthread/semaphore.h: Don't include sys/types.h.
* sysdeps/unix/sysv/linux/bits/uio-ext.h: Use __pid_t, not pid_t.

* sysdeps/generic/netinet/in_systm.h: Rename to
inet/netinet/in_systm.h.  Include bits/stdint-uintn.h,
not sys/types.h or stdint.h.
* sysdeps/generic/netinet/ip.h: Rename to
inet/netinet/ip.h.  Include bits/stdint-uintn.h and
bits/endian.h, not sys/types.h.
* sysdeps/gnu/netinet/tcp.h: Rename to
inet/netinet/tcp.h. Include bits/stdint-uintn.h and
bits/endian.h, not sys/types.h or stdint.h.
* sydeps/gnu/net/if.h: Rename to socket/net/if.h.
Don’t include sys/types.h.

* include/net/if.h: Include socket/net/if.h, rather than
whatever the next net/if.h on the include path is.
* include/netinet/in_systm.h, include/netinet/ip.h
* include/netinet/tcp.h: New trivial wrappers.

* sysdeps/generic/net/if.h: Delete, never used.
* sysdeps/generic/netinet/tcp.h: Delete, never used.

* bits/utmp.h: Delete file.
        * sysdeps/gnu/bits/utmp.h: Move to bits/utmp.h.
        Add multiple include guard.
        Don’t include paths.h, sys/time.h, or sys/types.h.
        Don’t use struct timeval.
        Use __intN_t for consistency with bits/utmpx.h.
        * sysdeps/unix/sysv/linux/s390/bits/utmp.h: Add multiple include guard.
        Don’t include paths.h, sys/time.h, sys/types.h, or bits/wordsize.h.
        Don’t use struct timeval.
        Use __intN_t for consistency with bits/utmpx.h.
        Use __time64_t unconditionally for lastlog.ll_time.
        Use __int64_t unconditionally for utmp.ut_session.
        Adjust indentation and blank lines to match bits/utmp.h.

        * sysdeps/gnu/bits/utmpx.h: Move to bits/utmpx.h.
        Add multiple include guard.
        Don’t include paths.h, sys/time.h, bits/types.h, or bits/wordsize.h.
        Don’t define _PATH_UTMPX or _PATH_WTMPX.
        Don’t use struct timeval.
        Use pid_t for consistency with bits/utmp.h.
        * sysdeps/unix/sysv/linux/s390/bits/utmpx.h: Add multiple include guard.
        Don’t define _PATH_UTMPX or _PATH_WTMPX.
        Don’t include paths.h, sys/time.h, bits/types.h, or bits/wordsize.h.
        Don’t define _PATH_UTMPX or _PATH_WTMPX.
        Don’t use struct timeval.
        Use pid_t for consistency with bits/utmp.h.
        Use __int64_t unconditionally for utmpx.ut_session.

        * login/utmp.h: Don’t include sys/types.h.
        Do include paths.h, bits/types.h, bits/types/pid_t.h,
        bits/types/suseconds_t, bits/types/time_t.h, and
        bits/types/struct_timeval.h.
        Move __BEGIN_DECLS to enclose only prototypes.

        * sysdeps/gnu/utmpx.h: Move to login/utmpx.h.
        Don’t include sys/time.h.  Do include bits/types.h,
        bits/types/suseconds_t, bits/types/time_t.h, and
        bits/types/struct_timeval.h.
        When __USE_GNU, include paths.h and define _PATH_UTMPX and _PATH_WTMPX.

        * login/Makefile (headers): Add utmpx.h and bits/utmpx.h.
        (routines): Add endutxent, getutmp, getutmpx, getutxent,
        getutxid, getutxline, pututxline, setutxent, updwtmpx, and
        utmpxname.  Reorganize.
        * sysdeps/gnu/Makefile: Do not add anything to sysdep_routines
        or sysdep_headers when subdir == login.

* sysdeps/gnu/sys/mtio.h: Move to misc/sys/mtio.h.
Don't include sys/types.h.
* sysdeps/gnu/Makefile: Don't add anything to sysdep_headers
for the misc directory.
* misc/Makefile (headers): Add sys/mtio.h.
* include/sys/mtio.h: New wrapper.

* elf/link.h, inet/aliases.h, misc/sys/xattr.h:
Don't include sys/types.h.  Include bits/types/size_t.h.

* gmon/sys/gmon.h: Don't include sys/types.h.
* gmon/sys/profil.h: Don't include sys/types.h.
Include bits/types/size_t.h and bits/types/struct_timeval.h.
* io/fts.h: Don't include sys/types.h.
Include bits/types/dev_t.h, bits/types/ino_t.h, bits/types/ino64_t.h,
and bits/types/nlink_t.h.
* io/sys/sendfile.h: Don't include sys/types.h.
Include bits/types.h, bits/types/off_t.h, bits/types/size_t.h,
and bits/types/ssize_t.h.
* stdlib/sys/random.h: Don't include sys/types.h.
Include bits/types/size_t.h and bits/types/ssize_t.h.

* gmon/tst-sprofil.h: Include sys/time.h.
* sysdeps/mach/hurd/sendfile.c: Include sys/types.h.

* sysdeps/unix/sysv/linux/sys/epoll.h: Don’t include stdint.h
or sys/types.h.  Do include features.h and bits/types.h.
(union epoll_data, struct epoll_event): Use __uint32_t and
__uint64_t for field types.

* sysdeps/unix/sysv/linux/alpha/bits/epoll.h
* sysdeps/unix/sysv/linux/bits/epoll.h
* sysdeps/unix/sysv/linux/hppa/bits/epoll.h
* sysdeps/unix/sysv/linux/mips/bits/epoll.h
* sysdeps/unix/sysv/linux/sparc/bits/epoll.h
* sysdeps/unix/sysv/linux/x86/bits/epoll.h:
Add multiple inclusion guard.

* sysdeps/unix/sysv/linux/alpha/sys/acct.h: Style fix.
* sysdeps/unix/sysv/linux/sys/acct.h: Include features.h
and bits/stdint-uintn.h.  Don't include sys/types.h, stdint.h,
or bits/types/time_t.h.

* sysdeps/unix/sysv/linux/sys/fsuid.h
* sysdeps/unix/sysv/linux/sys/quota.h
Include bits/types.h, not sys/types.h.

* sysdeps/nptl/sys/procfs.h: Include features.h and bits/types.h,
not sys/types.h.
* sysdeps/nptl/thread_db.h: Don’t include sys/types.h.
* sysdeps/nptl/proc_service.h: Include bits/types/pid_t.h and
bits/types/size_t.h.

* sysdeps/unix/sysv/linux/sys/procfs.h: Include bits/types.h and
bits/types/struct_timeval.h, not sys/time.h or sys/types.h.

* sysdeps/unix/sysv/linux/aarch64/bits/procfs.h: Add multiple
inclusion guard.  Include bits/types.h.  Correct a comment.

* sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h:
Add multiple inclusion guard.  Include sys/ucontext.h.

* sysdeps/unix/sysv/linux/alpha/bits/procfs.h
* sysdeps/unix/sysv/linux/sparc/bits/procfs.h
Add multiple inclusion guard.  Don’t include signal.h or sys/ucontext.h.
* sysdeps/unix/sysv/linux/ia64/bits/procfs.h:
        Add multiple inclusion guard.  Include sys/ucontext.h, not signal.h.
* sysdeps/unix/sysv/linux/powerpc/bits/procfs.h:
        Add multiple inclusion guard.  Don’t include signal.h or
sys/ucontext.h.  Include bits/wordsize.h and asm/elf.h.
Adjust conditional for whether to provide various fallback
definitions.

* sysdeps/unix/sysv/linux/arm/bits/procfs.h
* sysdeps/unix/sysv/linux/csky/bits/procfs.h
* sysdeps/unix/sysv/linux/hppa/bits/procfs.h
* sysdeps/unix/sysv/linux/m68k/bits/procfs.h
* sysdeps/unix/sysv/linux/microblaze/bits/procfs.h
* sysdeps/unix/sysv/linux/mips/bits/procfs.h
* sysdeps/unix/sysv/linux/nios2/bits/procfs.h
* sysdeps/unix/sysv/linux/riscv/bits/procfs.h
* sysdeps/unix/sysv/linux/s390/bits/procfs.h
* sysdeps/unix/sysv/linux/sh/bits/procfs.h
* sysdeps/unix/sysv/linux/x86/bits/procfs.h:
        Add multiple inclusion guard.  Improve commentary.

* sysdeps/posix/dl-fileid.h (r_file_id): Use __dev_t and __ino64_t
for field types.

* nss/nss.h
* sysdeps/powerpc/sys/platform/ppc.h
* sysdeps/unix/sysv/linux/sys/eventfd.h
* sysdeps/unix/sysv/linux/sys/fanotify.h
* sysdeps/unix/sysv/linux/sys/inotify.h
* sysdeps/unix/sysv/linux/sys/raw.h
* sysdeps/unix/sysv/linux/sys/signalfd.h:
Include bits/types.h, not stdint.h.
Include features.h where not already doing so.
Use __(u)intN_t types instead of (u)intN_t types in all
declarations.

* sysdeps/unix/sysv/linux/powerpc/bits/powerpc.h:
Use __uint64_t instead of uint64_t.
* nss/tst-nss-test4.c: Include stdint.h.

* bits/fcntl.h: Add multiple include guard.  Hoist inclusion of
bits/types.h to top of file.
* sysdeps/mach/hurd/bits/fcntl.h: Add multiple include guard.
Include bits/types.h, not sys/types.h; remove redundant inclusion
of bits/types.h in middle of file.

* bits/sem.h: Add multiple include guard.  Include bits/types.h,
not sys/types.h.
* sysdeps/gnu/bits/sem.h: Likewise.
* sysdeps/unix/sysv/linux/bits/sem.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/ipc.h: Likewise.
* sysvipc/sys/sem.h: Include bits/types/pid_t.h and
bits/types/time_t.h.

* resolv/bits/types/res_state.h: Include bits/types.h, not
sys/types.h.  Use __uint32_t and __uint16_t, not uint32_t and
uint16_t.

* sysdeps/mach/hurd/bits/socket.h: Include bits/types.h, not
sys/types.h.
* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.  Use __pid_t,
__uid_t, and __gid_t, not pid_t, uid_t, and gid_t.
* socket/sys/socket.h: Include bits/types.h, bits/types/ssize_t.h,
and bits/types/socklen_t.h.
* inet/htonl.c, include/htons.c: Include endian.h.
* include/netinet/ether.h: Include bits/types/size_t.h.

* scripts/check-obsolete-constructs.py
(HEADER_ALLOWED_INCLUDES, SYSDEP_ALLOWED_INCLUDES): Update.

* sysdeps/mach/hurd/i386/Makefile: Update list of xfails for
        bug 23088.

98 files changed:
bits/fcntl.h
bits/sem.h
bits/utmp.h
bits/utmpx.h [moved from sysdeps/gnu/bits/utmpx.h with 84% similarity]
elf/link.h
gmon/sys/gmon.h
gmon/sys/profil.h
gmon/tst-sprofil.c
include/net/if.h
include/netinet/ether.h
include/netinet/in_systm.h [new file with mode: 0644]
include/netinet/ip.h [new file with mode: 0644]
include/netinet/tcp.h [new file with mode: 0644]
include/sys/mtio.h [new file with mode: 0644]
include/utmpx.h [new file with mode: 0644]
inet/aliases.h
inet/htonl.c
inet/htons.c
inet/netinet/in_systm.h [moved from sysdeps/generic/netinet/in_systm.h with 97% similarity]
inet/netinet/ip.h [moved from sysdeps/generic/netinet/ip.h with 99% similarity]
inet/netinet/tcp.h [moved from sysdeps/gnu/netinet/tcp.h with 99% similarity]
io/fts.h
io/ftw.h
io/sys/sendfile.h
login/Makefile
login/utmp.h
login/utmpx.h [moved from sysdeps/gnu/utmpx.h with 94% similarity]
misc/Makefile
misc/sys/mtio.h [moved from sysdeps/gnu/sys/mtio.h with 99% similarity]
misc/sys/uio.h
misc/sys/xattr.h
nss/nss.h
nss/tst-nss-test4.c
posix/spawn.h
resolv/bits/types/res_state.h
rt/aio.h
rt/mqueue.h
scripts/check-obsolete-constructs.py
socket/net/if.h [moved from sysdeps/gnu/net/if.h with 98% similarity]
socket/sys/socket.h
stdlib/sys/random.h
sysdeps/generic/net/if.h [deleted file]
sysdeps/generic/netinet/tcp.h [deleted file]
sysdeps/gnu/Makefile
sysdeps/gnu/bits/sem.h
sysdeps/mach/hurd/bits/fcntl.h
sysdeps/mach/hurd/bits/socket.h
sysdeps/mach/hurd/i386/Makefile
sysdeps/mach/hurd/sendfile.c
sysdeps/nptl/proc_service.h
sysdeps/nptl/sys/procfs.h
sysdeps/nptl/thread_db.h
sysdeps/posix/dl-fileid.h
sysdeps/powerpc/sys/platform/ppc.h
sysdeps/pthread/semaphore.h
sysdeps/unix/sysv/linux/aarch64/bits/procfs.h
sysdeps/unix/sysv/linux/alpha/bits/epoll.h
sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
sysdeps/unix/sysv/linux/alpha/bits/procfs.h
sysdeps/unix/sysv/linux/alpha/sys/acct.h
sysdeps/unix/sysv/linux/arm/bits/procfs.h
sysdeps/unix/sysv/linux/bits/epoll.h
sysdeps/unix/sysv/linux/bits/sem.h
sysdeps/unix/sysv/linux/bits/socket.h
sysdeps/unix/sysv/linux/bits/uio-ext.h
sysdeps/unix/sysv/linux/csky/bits/procfs.h
sysdeps/unix/sysv/linux/hppa/bits/epoll.h
sysdeps/unix/sysv/linux/hppa/bits/procfs.h
sysdeps/unix/sysv/linux/ia64/bits/procfs.h
sysdeps/unix/sysv/linux/m68k/bits/procfs.h
sysdeps/unix/sysv/linux/microblaze/bits/procfs.h
sysdeps/unix/sysv/linux/microblaze/sys/user.h
sysdeps/unix/sysv/linux/mips/bits/epoll.h
sysdeps/unix/sysv/linux/mips/bits/procfs.h
sysdeps/unix/sysv/linux/nios2/bits/procfs.h
sysdeps/unix/sysv/linux/powerpc/bits/ppc.h
sysdeps/unix/sysv/linux/powerpc/bits/procfs.h
sysdeps/unix/sysv/linux/powerpc/sys/user.h
sysdeps/unix/sysv/linux/riscv/bits/procfs.h
sysdeps/unix/sysv/linux/s390/bits/procfs.h
sysdeps/unix/sysv/linux/s390/bits/utmp.h
sysdeps/unix/sysv/linux/s390/bits/utmpx.h
sysdeps/unix/sysv/linux/sh/bits/procfs.h
sysdeps/unix/sysv/linux/sparc/bits/epoll.h
sysdeps/unix/sysv/linux/sparc/bits/procfs.h
sysdeps/unix/sysv/linux/sys/acct.h
sysdeps/unix/sysv/linux/sys/epoll.h
sysdeps/unix/sysv/linux/sys/eventfd.h
sysdeps/unix/sysv/linux/sys/fanotify.h
sysdeps/unix/sysv/linux/sys/fsuid.h
sysdeps/unix/sysv/linux/sys/inotify.h
sysdeps/unix/sysv/linux/sys/procfs.h
sysdeps/unix/sysv/linux/sys/quota.h
sysdeps/unix/sysv/linux/sys/raw.h
sysdeps/unix/sysv/linux/sys/signalfd.h
sysdeps/unix/sysv/linux/x86/bits/epoll.h
sysdeps/unix/sysv/linux/x86/bits/procfs.h
sysvipc/sys/sem.h

index a8278242e53e31ce53976e3d7e3ec2756cd41b4c..ad1b58f6d88c8fc8dd51a8ccb6b2ad50b5fec924 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_FCNTL_H
+#define _BITS_FCNTL_H 1
+
 #ifndef        _FCNTL_H
 #error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
 #endif
 
+#include <bits/types.h>
 
 /* File access modes for `open' and `fcntl'.  */
 #define        O_RDONLY        0       /* Open read-only.  */
 /* File descriptor flags used with F_GETFD and F_SETFD.  */
 #define        FD_CLOEXEC      1       /* Close on exec.  */
 
-
-#include <bits/types.h>
-
 /* 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
index a84bfb1dd152b9e1e02dc874718c8cb66381596e..80615e7d8fc602cf5588aa2faea2f865fcc04260 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_SEM_H
+#define _BITS_SEM_H 1
+
 #ifndef _SYS_SEM_H
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* 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 */
index b82d14536f0bd5386a7c1e069910268524b2f879..e8e88cc00fdf525f05e0b97469b55d76f4ff4d56 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_UTMP_H
+#define _BITS_UTMP_H 1
+
 #ifndef _UTMP_H
 # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
 #endif
 
-#include <paths.h>
-#include <sys/time.h>
-#include <sys/types.h>
 #include <bits/wordsize.h>
 
 
@@ -36,7 +36,7 @@
 struct lastlog
   {
 #if __WORDSIZE_TIME64_COMPAT32
-    int32_t ll_time;
+    __int32_t ll_time;
 #else
     __time_t ll_time;
 #endif
@@ -69,23 +69,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.  */
@@ -125,3 +131,5 @@ struct utmp
 #define _HAVE_UT_ID    1
 #define _HAVE_UT_TV    1
 #define _HAVE_UT_HOST  1
+
+#endif /* bits/utmp.h */
similarity index 84%
rename from sysdeps/gnu/bits/utmpx.h
rename to bits/utmpx.h
index dfd55bfcc368a574c9201cd07636f56ccfb82e40..b8f2e16a6ff10d387ee9f13754227952cfe0317b 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_UTMPX_H
+#define _BITS_UTMPX_H 1
+
 #ifndef _UTMPX_H
 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
 #endif
 
-#include <bits/types.h>
-#include <sys/time.h>
-#include <bits/wordsize.h>
-
-
-#ifdef __USE_GNU
-# include <paths.h>
-# define _PATH_UTMPX   _PATH_UTMP
-# define _PATH_WTMPX   _PATH_WTMP
-#endif
-
-
 #define __UT_LINESIZE  32
 #define __UT_NAMESIZE  32
 #define __UT_HOSTSIZE  256
@@ -67,9 +58,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
@@ -78,9 +70,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.  */
 };
@@ -104,3 +101,5 @@ struct utmpx
 #ifdef __USE_GNU
 # define ACCOUNTING    9       /* System accounting.  */
 #endif
+
+#endif /* bits/utmpx.h */
index 0048ad5d4d0d43ca991497852c8dfac4dbe7edcc..3f4c2cce53944b31e2da4e4737e292d000c4e5e5 100644 (file)
@@ -23,7 +23,6 @@
 #include <features.h>
 #include <elf.h>
 #include <dlfcn.h>
-#include <sys/types.h>
 
 /* 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 <bits/types/size_t.h>
 #include <bits/elfclass.h>             /* Defines __ELF_NATIVE_CLASS.  */
 #include <bits/link.h>
 
index b4cc3b043a2aec77d55d4bb819cf24ae6c9a0ed0..5d7de0fe9b2cde9706c66c9ec48cab2697a67bc5 100644 (file)
@@ -34,8 +34,6 @@
 
 #include <features.h>
 
-#include <sys/types.h>
-
 /*
  * See gmon_out.h for gmon.out format.
  */
index 9f71e6d0812a08fdce6327f068f89600d5b3db1e..5a1ce09ac5d2267e75ae0de23118702d7e0d7ed7 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <features.h>
 
-#include <sys/time.h>
-#include <sys/types.h>
+#include <bits/types/size_t.h>
+#include <bits/types/struct_timeval.h>
 
 /* This interface is intended to follow the sprofil() system calls as
    described by the sprofil(2) man page of Irix v6.5, except that:
index 6663a97caf59b85b6fb0181ac98dc96d58824464..93de84b5b404b3e9514de691d6921be83266ac65 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/profil.h>
+#include <sys/time.h>
 
 #include <bits/wordsize.h>
 
index 6c4cbc96c3733a01552f8f4cfdf2abdb67954c15..2e7af05ed20888260c86155c3ff7d0674d1c3672 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef _NET_IF_H
 
-# include_next <net/if.h>
+#include <socket/net/if.h>
 
 #ifndef _ISOMAC
 libc_hidden_proto (if_nametoindex)
index 8bfe7e03ad4d1c03c285be7763c88aaffd83b117..a60aa27240fe2184588b7458ee3c4e7b0a074509 100644 (file)
@@ -2,6 +2,7 @@
 #include <inet/netinet/ether.h>
 
 # ifndef _ISOMAC
+#  include <bits/types/size_t.h>
 
 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 (file)
index 0000000..7634c9b
--- /dev/null
@@ -0,0 +1 @@
+#include <inet/netinet/in_systm.h>
diff --git a/include/netinet/ip.h b/include/netinet/ip.h
new file mode 100644 (file)
index 0000000..da55733
--- /dev/null
@@ -0,0 +1 @@
+#include <inet/netinet/ip.h>
diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
new file mode 100644 (file)
index 0000000..edba529
--- /dev/null
@@ -0,0 +1 @@
+#include <inet/netinet/tcp.h>
diff --git a/include/sys/mtio.h b/include/sys/mtio.h
new file mode 100644 (file)
index 0000000..f4861bd
--- /dev/null
@@ -0,0 +1 @@
+#include <misc/sys/mtio.h>
diff --git a/include/utmpx.h b/include/utmpx.h
new file mode 100644 (file)
index 0000000..cfe9b7c
--- /dev/null
@@ -0,0 +1 @@
+#include <login/utmpx.h>
index b22ed63831553bf526b9642773a0b0d0186a4b73..e868866baa6b38a0e07e3a4e36c3f08aca730b3d 100644 (file)
@@ -19,9 +19,7 @@
 #define _ALIASES_H     1
 
 #include <features.h>
-
-#include <sys/types.h>
-
+#include <bits/types/size_t.h>
 
 __BEGIN_DECLS
 
index e171273365d5a8b96c03ad47702a2e1937b5f0e5..3eb174fb4b22e46cb11b5e563896847aedfb3dec 100644 (file)
@@ -15,8 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <stdint.h>
 #include <netinet/in.h>
+#include <endian.h>
+#include <stdint.h>
 
 #undef htonl
 #undef ntohl
index 9500e4cfb6d657483faa683b6ae029d2bacf17e5..71d48617533942fdb4ddca7c219421759129bd6e 100644 (file)
@@ -16,6 +16,8 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <netinet/in.h>
+#include <endian.h>
+#include <stdint.h>
 
 #undef htons
 #undef ntohs
similarity index 97%
rename from sysdeps/generic/netinet/in_systm.h
rename to inet/netinet/in_systm.h
index b22b26f148abd4efc4a12ae5c5e8dbc6a8aff5b2..960f2af8fa9f2b733229aa224f7020113aa323da 100644 (file)
@@ -19,8 +19,7 @@
 #ifndef _NETINET_IN_SYSTM_H
 #define _NETINET_IN_SYSTM_H 1
 
-#include <sys/types.h>
-#include <stdint.h>
+#include <bits/stdint-uintn.h>
 
 __BEGIN_DECLS
 
similarity index 99%
rename from sysdeps/generic/netinet/ip.h
rename to inet/netinet/ip.h
index 8605193a440cf42d5a1144b1c2549add2fa2c699..8dd7f6a40e5f962630447cbeee29136bcce493b1 100644 (file)
 #define __NETINET_IP_H 1
 
 #include <features.h>
-#include <sys/types.h>
 
 #include <netinet/in.h>
+#include <bits/endian.h>
+#include <bits/stdint-uintn.h>
 
 __BEGIN_DECLS
 
similarity index 99%
rename from sysdeps/gnu/netinet/tcp.h
rename to inet/netinet/tcp.h
index 41ca11b5f50853562ff6698cafb73cd8a79b14cc..243b55a24c59fb1727f78d9095bc5086dde03ae4 100644 (file)
@@ -86,9 +86,9 @@
 #define TCP_REPAIR_OFF_NO_WP    -1
 
 #ifdef __USE_MISC
-# include <sys/types.h>
+# include <bits/stdint-uintn.h>
+# include <bits/endian.h>
 # include <sys/socket.h>
-# include <stdint.h>
 
 typedef        uint32_t tcp_seq;
 /*
index 3e2d18403d9ffefe620033785e94a2bdcec09433..811ceff3065550f8cea4577c61397b0bc2869de4 100644 (file)
--- a/io/fts.h
+++ b/io/fts.h
 #define        _FTS_H 1
 
 #include <features.h>
-#include <sys/types.h>
 
+#include <bits/types/dev_t.h>
+#include <bits/types/ino_t.h>
+#include <bits/types/ino64_t.h>
+#include <bits/types/nlink_t.h>
 
 typedef struct {
        struct _ftsent *fts_cur;        /* current node */
index 8cf9df1755320c0284733d80c359cfc4357e771e..6e56129c45d1340bc9469ada1ae48c8173c06af6 100644 (file)
--- a/io/ftw.h
+++ b/io/ftw.h
@@ -24,7 +24,6 @@
 
 #include <features.h>
 
-#include <sys/types.h>
 #include <sys/stat.h>
 
 
index e11cbc42191ae51e452fc116263030e7e75c32b2..130a79171ab59204b7413ee16725e902112d31c8 100644 (file)
 #define _SYS_SENDFILE_H        1
 
 #include <features.h>
-#include <sys/types.h>
+
+#include <bits/types.h>
+#include <bits/types/off_t.h>
+#include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
 
 __BEGIN_DECLS
 
index d897057bbde0d8b07bb56a37e4745c3b1786cedc..b4cc2069d4b16274480759af25ec3da6950c0162 100644 (file)
@@ -23,12 +23,15 @@ subdir      := login
 
 include ../Makeconfig
 
-headers        := utmp.h bits/utmp.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
+headers        := utmp.h bits/utmp.h utmpx.h bits/utmpx.h lastlog.h pty.h
+
+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)"'
 
index 3de2b8596b8b6121006de13fc94cefafff44c35a..fa473df3dfcbfde593d86b519948ccff8bcfe73e 100644 (file)
 
 #include <features.h>
 
-#include <sys/types.h>
-
-
-__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 <bits/types.h>
+#include <bits/types/pid_t.h>
+#include <bits/types/suseconds_t.h>
+#include <bits/types/time_t.h>
+#include <bits/types/struct_timeval.h>
 
 /* Get system dependent values and data structures.  */
 #include <bits/utmp.h>
 
 /* Compatibility names for the strings of the canonical file names.  */
+#include <paths.h>
 #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.  */
similarity index 94%
rename from sysdeps/gnu/utmpx.h
rename to login/utmpx.h
index b1a82a46cf08e99e5a4308d7e6ad6adf59c403e5..6394138713c17e8814572c1a1aef3e140aa381f0 100644 (file)
 #define        _UTMPX_H        1
 
 #include <features.h>
-#include <sys/time.h>
 
 /* Required according to Unix98.  */
+#include <bits/types.h>
 #include <bits/types/pid_t.h>
+#include <bits/types/suseconds_t.h>
+#include <bits/types/time_t.h>
+#include <bits/types/struct_timeval.h>
 
 /* Get system dependent values and data structures.  */
 #include <bits/utmpx.h>
 
 #ifdef __USE_GNU
+# include <paths.h>
+# 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
index a25146d33219ca593283cb765305f2981f7514a3..3edb93ef8c7277655b6ffa55d7a476956fb30880 100644 (file)
@@ -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 \
similarity index 99%
rename from sysdeps/gnu/sys/mtio.h
rename to misc/sys/mtio.h
index 17a9b210d9ee11757321d1cf4ce9d6303759ff2e..a36a256c537d45a7d0e519abff34fa7282d18889 100644 (file)
 #ifndef _SYS_MTIO_H
 #define _SYS_MTIO_H    1
 
-/* Get necessary definitions from system and kernel headers.  */
-#include <sys/types.h>
 #include <sys/ioctl.h>
 
-
 /* Structure for MTIOCTOP - magnetic tape operation command.  */
 struct mtop
   {
index 26d87c9f34fc0a2fc56784c86fac458e97778d17..6847998f6c669491af26b334161ed75f16945ea1 100644 (file)
 #define _SYS_UIO_H     1
 
 #include <features.h>
-#include <sys/types.h>
+
+#include <bits/types.h>
+#include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
 #include <bits/types/struct_iovec.h>
 #include <bits/uio_lim.h>
 #ifdef __IOV_MAX
index e3a43c1ea2345afc95de527dd441e5af8bf70274..8061587497a8d2e88acc6c7461150902114d7c1f 100644 (file)
@@ -19,8 +19,9 @@
 #define _SYS_XATTR_H   1
 
 #include <features.h>
-#include <sys/types.h>
 
+#include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
 
 __BEGIN_DECLS
 
index 390ea34aafc167019a98e831a22f23b5998387ef..a024fd7a061b3d93e49203d56189c49b7b02c643 100644 (file)
--- a/nss/nss.h
+++ b/nss/nss.h
@@ -22,7 +22,7 @@
 #define _NSS_H 1
 
 #include <features.h>
-#include <stdint.h>
+#include <bits/types.h>
 
 
 __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;
   };
 
 
index e9062eec2eab941299886701fa43c7bef861072c..45581fc3df0bbcce950f3732210ac8f32d219af7 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdint.h>
 
 #include <support/support.h>
 
index be6bd591a33f102bf5579910388bc6e6e3940c88..a51541918ca9901908a56faef8b5dabe687c64cc 100644 (file)
 
 #include <features.h>
 #include <sched.h>
-#include <sys/types.h>
+
+#include <bits/types.h>
+#include <bits/types/mode_t.h>
+#include <bits/types/pid_t.h>
 #include <bits/types/sigset_t.h>
 
 
index 2544a627f6eb0d2cf1b14a286fc6ce7eb3832fad..81febe13b0a7a8d332e7e0e0db56112da9887af7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __res_state_defined
 #define __res_state_defined 1
 
-#include <sys/types.h>
+#include <bits/types.h>
 #include <netinet/in.h>
 
 /* 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
index 2bbcc6adc713aaa7b8f81ba7fc845c3137c67f66..87827f1888e9a24f88b9e3c93a297fe8fbe134e4 100644 (file)
--- a/rt/aio.h
+++ b/rt/aio.h
 #define _AIO_H 1
 
 #include <features.h>
-#include <sys/types.h>
+
+#include <bits/types.h>
+#include <bits/pthreadtypes.h>
+#include <bits/types/off_t.h>
+#include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
 #include <bits/types/sigevent_t.h>
 #include <bits/sigevent-consts.h>
 #include <bits/types/struct_timespec.h>
index a2a2aa17718a160e3a47e024a6621911c3236727..b96a2ab573d2a67d331323fb20a3a63c591591e5 100644 (file)
 #define _MQUEUE_H      1
 
 #include <features.h>
-#include <sys/types.h>
 #include <fcntl.h>
+
+#include <bits/types.h>
+#include <bits/pthreadtypes.h>
 #include <bits/types/sigevent_t.h>
+#include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
 #include <bits/types/struct_timespec.h>
+
 /* Get the definition of mqd_t and struct mq_attr.  */
 #include <bits/mqueue.h>
 
+
 __BEGIN_DECLS
 
 /* Establish connection between a process and a message queue NAME and
index 511c13d6a64394c4439a300b1cf3019a68fb1c1e..1a0e91cf639a31249e3e36342a285165f6d153b3 100755 (executable)
@@ -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" ],
     },
similarity index 98%
rename from sysdeps/gnu/net/if.h
rename to socket/net/if.h
index 8ab14d0d1481e89aed8a91d3a8fc92847402a4ed..8431e000a2f9ff764e487c26b1a14ed744b05d0d 100644 (file)
 
 #include <features.h>
 
-#ifdef __USE_MISC
-# include <sys/types.h>
-# include <sys/socket.h>
-#endif
-
-
 /* Length of interface name.  */
 #define IF_NAMESIZE    16
 
@@ -38,6 +32,8 @@ struct if_nameindex
 
 
 #ifdef __USE_MISC
+# include <sys/socket.h>  /* for struct sockaddr */
+
 /* Standard interface flags. */
 enum
   {
index 305e6201f9c1181a1a2d92332d5f07dc2c1e9d1c..6a68164e3956e67578002c4e2f8e7b0b3c942307 100644 (file)
 
 __BEGIN_DECLS
 
+#include <bits/types.h>
 #include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
+#include <bits/types/socklen_t.h>
 #include <bits/types/struct_iovec.h>
 
 /* This operating system-specific header file defines the SOCK_*, PF_*,
index b351ef5c8c1549daf16c0d23b053052c2448d1c0..5edef78eb7011b0ceb8ab1a437327d9a87644135 100644 (file)
@@ -20,7 +20,9 @@
 #define _SYS_RANDOM_H 1
 
 #include <features.h>
-#include <sys/types.h>
+
+#include <bits/types/size_t.h>
+#include <bits/types/ssize_t.h>
 
 /* 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 (file)
index 38238d7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* net/if.h -- declarations for inquiring about network interfaces
-   Copyright (C) 2000-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _NET_IF_H
-
-#define _NET_IF_H      1
-#include <features.h>
-
-
-__BEGIN_DECLS
-
-/* Convert an interface name to an index, and vice versa.  */
-
-extern unsigned int if_nametoindex (const char *__ifname) __THROW;
-extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW;
-
-/* Return a list of all interfaces and their indices.  */
-
-struct if_nameindex
-  {
-    unsigned int if_index;     /* 1, 2, ... */
-    char *if_name;             /* null terminated name: "eth0", ... */
-  };
-
-extern struct if_nameindex *if_nameindex (void) __THROW;
-
-/* Free the data returned from if_nameindex.  */
-
-extern void if_freenameindex (struct if_nameindex *__ptr) __THROW;
-
-__END_DECLS
-
-
-#endif /* net/if.h */
diff --git a/sysdeps/generic/netinet/tcp.h b/sysdeps/generic/netinet/tcp.h
deleted file mode 100644 (file)
index 3b59e94..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *     @(#)tcp.h       8.1 (Berkeley) 6/10/93
- */
-
-#ifndef _NETINET_TCP_H
-#define _NETINET_TCP_H 1
-
-#include <features.h>
-
-__BEGIN_DECLS
-
-typedef        unsigned int    tcp_seq;
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr {
-       unsigned short  th_sport;       /* source port */
-       unsigned short  th_dport;       /* destination port */
-       tcp_seq         th_seq;         /* sequence number */
-       tcp_seq         th_ack;         /* acknowledgement number */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-       unsigned char   th_x2:4,        /* (unused) */
-                       th_off:4;       /* data offset */
-#endif
-#if __BYTE_ORDER == __BIG_ENDIAN
-       unsigned char   th_off:4,       /* data offset */
-                       th_x2:4;        /* (unused) */
-#endif
-       unsigned char   th_flags;
-#define        TH_FIN  0x01
-#define        TH_SYN  0x02
-#define        TH_RST  0x04
-#define        TH_PUSH 0x08
-#define        TH_ACK  0x10
-#define        TH_URG  0x20
-       unsigned short  th_win;         /* window */
-       unsigned short  th_sum;         /* checksum */
-       unsigned short  th_urp;         /* urgent pointer */
-};
-
-#define        TCPOPT_EOL              0
-#define        TCPOPT_NOP              1
-#define        TCPOPT_MAXSEG           2
-#define TCPOLEN_MAXSEG         4
-#define TCPOPT_WINDOW          3
-#define TCPOLEN_WINDOW         3
-#define TCPOPT_SACK_PERMITTED  4               /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
-#define TCPOPT_SACK            5               /* Experimental */
-#define TCPOPT_TIMESTAMP       8
-#define TCPOLEN_TIMESTAMP      10
-#define TCPOLEN_TSTAMP_APPA    (TCPOLEN_TIMESTAMP+2) /* appendix A */
-
-#define TCPOPT_TSTAMP_HDR      \
-    (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MSS of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-#define        TCP_MSS 512
-
-#define        TCP_MAXWIN      65535   /* largest value for (unscaled) window */
-
-#define TCP_MAX_WINSHIFT       14      /* maximum window shift */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define        TCP_NODELAY     0x01    /* don't delay send to coalesce packets */
-#define        TCP_MAXSEG      0x02    /* set maximum segment size */
-
-#define SOL_TCP                6       /* TCP level */
-
-__END_DECLS
-
-#endif /* netinet/tcp.h */
index 97fcb6fb909f3423fc81b026f85f029b8cd549a9..37b47c822365b4b69505fce333fab6e9e505955b 100644 (file)
@@ -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
index c2914d31544dc5a179dd5ab999cea6a5c98dec9e..02e24915b70c54a48eaf119c24ef1639474def1a 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_SEM_H
+#define _BITS_SEM_H 1
+
 #ifndef _SYS_SEM_H
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* 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 */
index 6678033857c3232f57f28bd1de0b6731a20eaa0a..ad6b1f91b4aa19fc23f7ae74b5f6db7c6dccbb8b 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_FCNTL_H
+#define _BITS_FCNTL_H 1
+
 #ifndef _FCNTL_H
 # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* File access modes.  These are understood by io servers; they can be
    passed in `dir_lookup', and are returned by `io_get_openmodes'.
 # 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 <bits/types.h>
-
 /* 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 */
index f7c6f562988abb336ccf915b8d856357f68d5eac..828a8efbf22c2eade727b19783d5cba1d1baac7b 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 
 
-#include <sys/types.h>
+#include <bits/types.h>
 #include <bits/types/size_t.h>
 #include <bits/types/socklen_t.h>
 #include <bits/wordsize.h>
index aa23a4b209202249d16858993e0928dae5039c53..50ce5634b203acce7809ed4ef2c284ae7153b252 100644 (file)
@@ -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
index 1a03dd3e9b8c3ede4c298402b34807bc0f451dc9..b68cfca1f782158dd44c61c52d4325615c276b9f 100644 (file)
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <sys/sendfile.h>
+#include <sys/types.h>
 #include <stddef.h>
 
 /* Send COUNT bytes from file associated with IN_FD starting at OFFSET to
index afb27b5b511916bb159f12ba4bb317d34720c260..6022ef17423a3b32aba706b1cce9816231491d42 100644 (file)
@@ -22,6 +22,9 @@
 /* The definitions in this file must correspond to those in the debugger.  */
 #include <sys/procfs.h>
 
+#include <bits/types/size_t.h>
+#include <bits/types/pid_t.h>
+
 __BEGIN_DECLS
 
 /* Functions in this interface return one of these status codes.  */
index d0e0dc4abd67870d7e820151754084e2d9e20219..67e33c48caa7a9735e328ba58b7954569eda6711 100644 (file)
@@ -19,7 +19,8 @@
 #ifndef _SYS_PROCFS_H
 #define _SYS_PROCFS_H  1
 
-#include <sys/types.h>
+#include <features.h>
+#include <bits/types.h>
 
 /* The rest of this file provides the types for emulation of the
    Solaris <proc_service.h> interfaces that should be implemented by
index bf073b7d862392dee3239e92e2b5392b888f9bd7..da5f2cdc478983139eda3590681883c6e5a18d9c 100644 (file)
@@ -24,7 +24,6 @@
    with the goal to share the same code in the debugger.  */
 #include <pthread.h>
 #include <stdint.h>
-#include <sys/types.h>
 #include <sys/procfs.h>
 #include <bits/types/sigset_t.h>
 
index 7d1e9e495044a91dba1cb9cc962d3ea45a22995f..39a4bffc674df872f449a9b14b0207701b7c847e 100644 (file)
@@ -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.
index 335868cb2a783f6c083a6a7b95beeb30bf0b19d8..83141903d218e50100ac058c94d24a074ee45fee 100644 (file)
 #define _SYS_PLATFORM_PPC_H    1
 
 #include <features.h>
-#include <stdint.h>
+#include <bits/types.h>
 #include <bits/ppc.h>
 
 /* 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
 }
index 436d21cb08a06fbb8fd87a6a9a88233524f1c750..2532cc9eecc9a64d385334c99b722523417542b7 100644 (file)
@@ -19,7 +19,7 @@
 #define _SEMAPHORE_H   1
 
 #include <features.h>
-#include <sys/types.h>
+
 #ifdef __USE_XOPEN2K
 # include <bits/types/struct_timespec.h>
 #endif
index e0afc7afe7c9abb702cea06059960be22d554a1f..51571cddaaebc18dbeb8460f0e7524eaaf3bdea8 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
+#include <bits/types.h>
+
 /* 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 */
index b9d05398e49e0342827d6a94a3e9bc46948ea52a..7769b6dd6a282c46f54924345091f7dd17e4a88a 100644 (file)
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef        _SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC  = 010000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
index a5baf1361da25e81bf52a742d405fa61f15fba63..cc748653774d8728933d07d0ff0921c8fc950dad 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_PRREGSET_H
+#define _BITS_PROCFS_PRREGSET_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs-prregset.h> directly; use <sys/procfs.h> instead."
 #endif
 
+/* For gregset_t and fpregset_t.  FIXME: sys/procfs.h should not
+   expose all of sys/ucontext.h.  */
+#include <sys/ucontext.h>
+
 typedef gregset_t __prgregset_t;
 typedef fpregset_t __prfpregset_t;
+
+#endif
index 9d2500665baedb625f204b43f79f14ba1c82668e..9d546a49fe057f1c989de35512f4c65903b556b6 100644 (file)
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-#include <signal.h>
-#include <sys/ucontext.h>
-
 /*
  * The OSF/1 version of <sys/procfs.h> 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 */
index defa3ba2f1552ffc9d1a78a1d11984128cfee93a..6ae4638802c32d0af10039b23176a3ccc7b5312b 100644 (file)
@@ -16,8 +16,8 @@
    <https://www.gnu.org/licenses/>.  */
 
 #ifndef _SYS_ACCT_H
-
 #define _SYS_ACCT_H    1
+
 #include <features.h>
 
 #include <bits/types/time_t.h>
index 7d0b30865d6894b127b9eb58689bcb1b47aef3e8..da703d9292a5dd26caffe3807c6dd32b5d5ea963 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> 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 */
index 164b464b2c708a499406428a291f5bf2156c5815..1202412cc35e02b7350494637720a4e1dee22b7a 100644 (file)
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef        _SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 02000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
index e0f4155c675e905a8c39f31f29e6a62b386fc3b4..7bbc7aab87d51ef55e76744388f804e465e4aa7c 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_SEM_H
+#define _BITS_SEM_H 1
+
 #ifndef _SYS_SEM_H
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 #include <bits/sem-pad.h>
 
 /* Flags for `semop'.  */
@@ -95,3 +98,5 @@ struct  seminfo
 };
 
 #endif /* __USE_MISC */
+
+#endif /* bits/sem.h */
index 65c72198ef83ee5616186bef093ee150892f8e70..e85fb589ce2ea1c4cc4a05bd9ada9053f8e0154e 100644 (file)
@@ -24,7 +24,7 @@
 #endif
 
 
-#include <sys/types.h>
+#include <bits/types.h>
 #include <bits/types/size_t.h>
 #include <bits/types/socklen_t.h>
 
@@ -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
 
index 85ceacddb4bd88dd0ec28c2154a5206a03d24ecb..ca27ffa6e7237bc4fb248a92336662e75ca19616 100644 (file)
@@ -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,
index 2be553eebac6bac699d16da57260a3ee6baed02d..ed084e4acbd08306d421c2ab33bffa005a3d1414 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> 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 */
index 85fb0a9c506ac7a94a01e04e353f41b7e6b55af1..1ba8cdfb48e04cc27cb9f3133bf72c7b0cdd974f 100644 (file)
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef        _SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 010000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
index 5de27f5b7ca38ccf23e6316026b7c50bb68e15ec..97d8e93dffe58f15ad6946aec727c31dbcb7de4a 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> 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 */
index 6c22aefe5afd38a19a0c5ce2842ad6868267411f..45d553c16f987e8518340307a4f9d5483fc51ca6 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-#include <signal.h>
+/* For struct __ia64_fpreg.  FIXME: sys/procfs.h should not expose all
+   of sys/ucontext.h.  */
 #include <sys/ucontext.h>
 #include <bits/sigcontext.h>
 
@@ -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 */
index d0c06a14f32c2c3316359a8d42409389cd9d12bd..ff53e73c76ddd9a37702293efdde6c6a181a8197 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> 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 */
index a7ba7a3e0bfe20369d93bfbaf64f457d14625fe6..acee07ff5ff37139920184209397f00c9316a0c7 100644 (file)
@@ -17,6 +17,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> 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 */
index 1ab0bb3f4b2696d5eb464664243da8eacec365fa..550ef47d02a514f8779d9858d7a2e804039223e9 100644 (file)
@@ -17,7 +17,9 @@
    <https://www.gnu.org/licenses/>.  */
 
 #ifndef _SYS_USER_H
-# define _SYS_USER_H   1
+#define _SYS_USER_H    1
+
+#include <features.h>
 
 #include <features.h>
 
index 164b464b2c708a499406428a291f5bf2156c5815..1202412cc35e02b7350494637720a4e1dee22b7a 100644 (file)
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef        _SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 02000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
index 86229f6bc407d699edbd6c68f98f07d6f7607340..aa9090cf8dcc513725c74e55c0a8149346c8b4bc 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
@@ -35,3 +38,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 */
index ad776a85a1bd40769028abd94ba494ade461e5a6..7d0f5ebd2cfd9568bca1d7c4e2fe7f24dc650346 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
@@ -32,3 +35,5 @@ 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 */
index 07c03c99555f91f9ef2997a216e2073677bb27cb..cc0e8102b7a20fc86c221e5b41548d2481c53a95 100644 (file)
@@ -26,7 +26,7 @@
 __BEGIN_DECLS
 
 /* Read the time base frequency.   */
-extern uint64_t __ppc_get_timebase_freq (void);
+extern __uint64_t __ppc_get_timebase_freq (void);
 
 __END_DECLS
 
index 5c73b39c72f6f0f81c397cac15b5d9c620b5ed11..88b795b5c1c6c638e49f97d45f7a277b0a976cef 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-#include <signal.h>
-#include <sys/ucontext.h>
+#include <bits/wordsize.h>
+#include <asm/elf.h>
+
+/* These definitions may have been provided by asm/elf.h.  Otherwise
+   we define them here.  */
+#ifndef ELF_NGREG
 
-/* These definitions are normally provided by ucontext.h via
-   asm/sigcontext.h, asm/ptrace.h, and asm/elf.h.  Otherwise we define
-   them here.  */
-#if !defined __PPC64_ELF_H && !defined _ASM_POWERPC_ELF_H
 #define ELF_NGREG       48      /* includes nip, msr, lr, etc. */
 #define ELF_NFPREG      33      /* includes fpscr */
 #if __WORDSIZE == 32
@@ -46,4 +49,7 @@ typedef struct {
   unsigned int u[4];
 } __attribute__ ((__aligned__ (16))) elf_vrreg_t;
 typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
-#endif
+
+#endif /* ifndef ELF_NGREG */
+
+#endif /* bits/procfs.h */
index d22634e108ecc7e934c2a4b7000987f2fdd98487..2833a06600cb80132e25a57bcb5a7bca7727ad38 100644 (file)
@@ -22,6 +22,7 @@
 #include <bits/types/size_t.h>
 
 #include <asm/ptrace.h>
+#include <bits/types/size_t.h>
 
 struct user {
        struct pt_regs  regs;                   /* entire machine state */
index 7e5b11509339f705d010a26ccc7b7238025a71fe..167991f28f7c62174d69f302207b03d34d80da55 100644 (file)
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
+/* FIXME: sys/ucontext.h does not define NGREG or NFPREG unless
+   __USE_MISC is active, and sys/procfs.h should not expose all of
+   sys/ucontext.h.  */
 #include <sys/ucontext.h>
 
 /* ELF register definitions */
@@ -29,3 +35,5 @@
 typedef unsigned long int elf_greg_t;
 typedef unsigned long int elf_gregset_t[32];
 typedef union __riscv_mc_fp_state elf_fpregset_t;
+
+#endif /* bits/procfs.h */
index 4d765aa87a4b0c73f7ffe592b29a0f72eefc35d3..633b8f6346351fb1bed29b42e3a464b1c6884552 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
+/* FIXME: sys/ucontext.h does not define NGREG unless __USE_MISC is
+   active, and sys/procfs.h should not expose all of sys/ucontext.h.  */
 #include <sys/ucontext.h>
 
 typedef greg_t elf_greg_t;
@@ -27,3 +32,5 @@ typedef greg_t elf_greg_t;
 typedef gregset_t elf_gregset_t;
 typedef fpreg_t   elf_fpreg_t;
 typedef fpregset_t elf_fpregset_t;
+
+#endif /* bits/procfs.h */
index ec0ee02303b1a9b55668c9445f302bceabfc3d4b..ffe5a2444deadc279af891a6422450c2732b6227 100644 (file)
@@ -1,4 +1,4 @@
-/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
+/* The `struct utmp' type, describing entries in the utmp file.  S/390 version.
    Copyright (C) 1993-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_UTMP_H
+#define _BITS_UTMP_H 1
+
 #ifndef _UTMP_H
 # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
 #endif
 
-#include <paths.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <bits/wordsize.h>
-
 
 #define UT_LINESIZE    32
 #define UT_NAMESIZE    32
    previous logins.  */
 struct lastlog
   {
-#if __WORDSIZE == 32
-    int64_t ll_time;
-#else
-    __time_t ll_time;
-#endif
+    __time64_t ll_time;
     char ll_line[UT_LINESIZE];
     char ll_host[UT_HOSTSIZE];
   };
@@ -64,28 +58,25 @@ struct utmp
   char ut_id[4]
     __attribute_nonstring__;   /* Inittab ID.  */
   char ut_user[UT_NAMESIZE]
-     __attribute_nonstring__;  /* Username.  */
+    __attribute_nonstring__;   /* Username.  */
   char ut_host[UT_HOSTSIZE]
-     __attribute_nonstring__;  /* Hostname for remote login.  */
+    __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.  */
-#if __WORDSIZE == 32
-  int64_t ut_session;          /* Session ID, used for windowing.  */
+   shared between 32- and 64-bit applications.  Even on 64-bit systems,
+   struct timeval is not guaranteed to have both fields be 64 bits.  */
+  __int64_t ut_session;                /* Session ID, used for windowing.  */
   struct
   {
-    int64_t tv_sec;            /* Seconds.  */
-    int64_t tv_usec;           /* Microseconds.  */
+    __int64_t tv_sec;          /* Seconds.  */
+    __int64_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.  */
-#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.  */
@@ -125,3 +116,5 @@ struct utmp
 #define _HAVE_UT_ID    1
 #define _HAVE_UT_TV    1
 #define _HAVE_UT_HOST  1
+
+#endif /* bits/utmp.h */
index d68df97bef5c787305fe9277017bc5f698072d7a..3321a29647c25c08e81b45f142afa4f1321c9a92 100644 (file)
@@ -1,4 +1,4 @@
-/* Structures and definitions for the user accounting database.  GNU version.
+/* Structures and definitions for the user accounting database.  S/390 version.
    Copyright (C) 1997-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_UTMPX_H
+#define _BITS_UTMPX_H 1
+
 #ifndef _UTMPX_H
 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
 #endif
 
-#include <bits/types.h>
-#include <sys/time.h>
-#include <bits/wordsize.h>
-
-
-#ifdef __USE_GNU
-# include <paths.h>
-# define _PATH_UTMPX   _PATH_UTMP
-# define _PATH_WTMPX   _PATH_WTMP
-#endif
-
-
 #define __UT_LINESIZE  32
 #define __UT_NAMESIZE  32
 #define __UT_HOSTSIZE  256
@@ -67,20 +58,17 @@ 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.  */
-#if __WORDSIZE == 32
+/* 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.  */
   __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.  */
-#else
-  long int ut_session;         /* Session ID, used for windowing.  */
-  struct timeval 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.  */
 };
@@ -104,3 +92,5 @@ struct utmpx
 #ifdef __USE_GNU
 # define ACCOUNTING    9       /* System accounting.  */
 #endif
+
+#endif /* bits/utmpx.h */
index 6b34f0a47381ef32c21b2901c613a9f1a1db170b..09f65188b98d01e8031d7080b44beed3fd1ab4ac 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
 /* elf_gregset_t and elf_fpregset_t are defined by sys/user.h for
    SH.  */
+
+#endif /* bits/procfs.h */
index 3c4abb96debc27da00132d49db85b589c5369c13..228cce6f1d65a5119770d4ba40102e6824b6d0ee 100644 (file)
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef        _SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 0x400000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
index ee813139a931d23f53b3b400b4b15f84744cea01..018671b44a416a390ba868cfe9d6ac270bab1e79 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-#include <signal.h>
-#include <sys/ucontext.h>
 #include <bits/wordsize.h>
 
 #if __WORDSIZE == 64
@@ -59,3 +60,5 @@ typedef struct
 
 typedef unsigned long elf_greg_t;
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+#endif /* bits/procfs.h */
index 2cae51bfcd60c7658dfb58d95f4df18677b2f5a5..057fd47a2429990d74a8c13ad30c7f5ccd702c69 100644 (file)
 #ifndef _SYS_ACCT_H
 #define _SYS_ACCT_H    1
 
-#include <sys/types.h>
-#include <stdint.h>
+#include <features.h>
+
 #include <bits/endian.h>
-#include <bits/types/time_t.h>
+#include <bits/stdint-uintn.h>
 
 __BEGIN_DECLS
 
index 3ca6d4820a62bba7b7a868454577dbe0016d37db..2f55076dd59a44a6d78ea883859403d326062c48 100644 (file)
@@ -18,9 +18,9 @@
 #ifndef        _SYS_EPOLL_H
 #define        _SYS_EPOLL_H    1
 
-#include <stdint.h>
-#include <sys/types.h>
+#include <features.h>
 
+#include <bits/types.h>
 #include <bits/types/sigset_t.h>
 
 /* Get the platform-dependent flags.  */
@@ -76,13 +76,13 @@ typedef union epoll_data
 {
   void *ptr;
   int fd;
-  uint32_t u32;
-  uint64_t u64;
+  __uint32_t u32;
+  __uint64_t u64;
 } epoll_data_t;
 
 struct epoll_event
 {
-  uint32_t events;     /* Epoll events */
+  __uint32_t events;   /* Epoll events */
   epoll_data_t data;   /* User data variable */
 } __EPOLL_PACKED;
 
index 10515b2a643a4e6e7de7a613a799e155b5a9fc61..fdd46e1582878be13d1c7639ebf931cd1c523fbf 100644 (file)
 #ifndef        _SYS_EVENTFD_H
 #define        _SYS_EVENTFD_H  1
 
-#include <stdint.h>
+#include <features.h>
+#include <bits/types.h>
 
 /* Get the platform-dependent flags.  */
 #include <bits/eventfd.h>
 
 /* Type for event counter.  */
-typedef uint64_t eventfd_t;
+typedef __uint64_t eventfd_t;
 
 
 __BEGIN_DECLS
index 84c0a8ba1ceaf8d7f7be49f8bab74e85a7855f88..678064f034a4c4935fd190dabf7cc371dd261084 100644 (file)
 #ifndef        _SYS_FANOTIFY_H
 #define        _SYS_FANOTIFY_H 1
 
-#include <stdint.h>
+#include <features.h>
+#include <bits/types.h>
 #include <linux/fanotify.h>
 
-
 __BEGIN_DECLS
 
 /* Create and initialize fanotify group.  */
@@ -30,7 +30,7 @@ extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags)
 
 /* Add, remove, or modify an fanotify mark on a filesystem object.  */
 extern int fanotify_mark (int __fanotify_fd, unsigned int __flags,
-                         uint64_t __mask, int __dfd, const char *__pathname)
+                         __uint64_t __mask, int __dfd, const char *__pathname)
      __THROW;
 
 __END_DECLS
index c3977b0aba7bb4901aebb721c36825b4f277a6f2..bb798b75f997e8d992d22e401bb4d600fb84a11c 100644 (file)
@@ -19,7 +19,7 @@
 #define _SYS_FSUID_H   1
 
 #include <features.h>
-#include <sys/types.h>
+#include <bits/types.h>
 
 __BEGIN_DECLS
 
index b57ab82d2f241e200dc46238c42242bd0522d801..c22c4e6f6669ad966de2e44ff95eba7affedf7ea 100644 (file)
@@ -18,7 +18,8 @@
 #ifndef        _SYS_INOTIFY_H
 #define        _SYS_INOTIFY_H  1
 
-#include <stdint.h>
+#include <features.h>
+#include <bits/types.h>
 
 /* Get the platform-dependent flags.  */
 #include <bits/inotify.h>
@@ -28,9 +29,9 @@
 struct inotify_event
 {
   int wd;              /* Watch descriptor.  */
-  uint32_t mask;       /* Watch mask.  */
-  uint32_t cookie;     /* Cookie to synchronize two events.  */
-  uint32_t len;                /* Length (including NULs) of name.  */
+  __uint32_t mask;     /* Watch mask.  */
+  __uint32_t cookie;   /* Cookie to synchronize two events.  */
+  __uint32_t len;      /* Length (including NULs) of name.  */
   char name __flexarr; /* Name.  */
 };
 
@@ -89,7 +90,7 @@ extern int inotify_init1 (int __flags) __THROW;
 
 /* Add watch of object NAME to inotify instance FD.  Notify about
    events specified by MASK.  */
-extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+extern int inotify_add_watch (int __fd, const char *__name, __uint32_t __mask)
   __THROW;
 
 /* Remove the watch specified by WD from the inotify instance FD.  */
index e432bbf7b1fa429f452d75e57e195e5c1587bd35..2d28399089bf9f2af2d4141ebc4caa3031e1d370 100644 (file)
    GDB unless you know what you are doing.  */
 
 #include <features.h>
-#include <sys/time.h>
-#include <sys/types.h>
+
+#include <bits/types.h>
+#include <bits/types/struct_timeval.h>
+
 #include <sys/user.h>
 
 /* bits/procfs.h, provided by each architecture, must define
index 23f00684b6ca65a7c2aa90ea570552504aa21e09..b972d3fdbafb539d52dedd184ac087bd919c94c6 100644 (file)
@@ -52,8 +52,8 @@
 #define _SYS_QUOTA_H 1
 
 #include <features.h>
-#include <sys/types.h>
 
+#include <bits/types.h>
 #include <linux/quota.h>
 
 /*
index 1bb47a3800ba1b8f9378e92d1434712c6d1bee96..0966d9af99df40de1e1114169fb1b3501baf54e3 100644 (file)
@@ -18,7 +18,8 @@
 #ifndef _SYS_RAW_H
 #define _SYS_RAW_H     1
 
-#include <stdint.h>
+#include <features.h>
+#include <bits/types.h>
 #include <sys/ioctl.h>
 
 /* The major device number for raw devices.  */
@@ -31,8 +32,8 @@
 struct raw_config_request
 {
   int raw_minor;
-  uint64_t block_major;
-  uint64_t block_minor;
+  __uint64_t block_major;
+  __uint64_t block_minor;
 };
 
 #endif /* sys/raw.h */
index bbaac7bd2bf92f66d08fc0c5869f9dd85409016d..e8fa3582894dd7eedcccc6a12880f4cb5c7dc3c1 100644 (file)
@@ -18,7 +18,8 @@
 #ifndef        _SYS_SIGNALFD_H
 #define        _SYS_SIGNALFD_H 1
 
-#include <stdint.h>
+#include <features.h>
+#include <bits/types.h>
 #include <bits/types/sigset_t.h>
 
 /* Get the platform-dependent flags.  */
 
 struct signalfd_siginfo
 {
-  uint32_t ssi_signo;
-  int32_t ssi_errno;
-  int32_t ssi_code;
-  uint32_t ssi_pid;
-  uint32_t ssi_uid;
-  int32_t ssi_fd;
-  uint32_t ssi_tid;
-  uint32_t ssi_band;
-  uint32_t ssi_overrun;
-  uint32_t ssi_trapno;
-  int32_t ssi_status;
-  int32_t ssi_int;
-  uint64_t ssi_ptr;
-  uint64_t ssi_utime;
-  uint64_t ssi_stime;
-  uint64_t ssi_addr;
-  uint16_t ssi_addr_lsb;
-  uint16_t __pad2;
-  int32_t ssi_syscall;
-  uint64_t ssi_call_addr;
-  uint32_t ssi_arch;
-  uint8_t __pad[28];
+  __uint32_t ssi_signo;
+  __int32_t ssi_errno;
+  __int32_t ssi_code;
+  __uint32_t ssi_pid;
+  __uint32_t ssi_uid;
+  __int32_t ssi_fd;
+  __uint32_t ssi_tid;
+  __uint32_t ssi_band;
+  __uint32_t ssi_overrun;
+  __uint32_t ssi_trapno;
+  __int32_t ssi_status;
+  __int32_t ssi_int;
+  __uint64_t ssi_ptr;
+  __uint64_t ssi_utime;
+  __uint64_t ssi_stime;
+  __uint64_t ssi_addr;
+  __uint16_t ssi_addr_lsb;
+  __uint16_t __pad2;
+  __int32_t ssi_syscall;
+  __uint64_t ssi_call_addr;
+  __uint32_t ssi_arch;
+  __uint8_t __pad[28];
 };
 
 __BEGIN_DECLS
index 0b34b3d6236d8e45ab5eb9168fe6cf987f981dd2..079cbf1341a0235308bac09d36be85b0e8072d0d 100644 (file)
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef        _SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -27,3 +30,5 @@ enum
   };
 
 #define __EPOLL_PACKED __attribute__ ((__packed__))
+
+#endif /* bits/epoll.h */
index 23012304b9daf7fd64bdd7d2c90d8ce9aa3a7841..19c045d64cac5485db27d02a3ea70f08fc0a8ac4 100644 (file)
@@ -16,6 +16,9 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_PROCFS_H
+#define _BITS_PROCFS_H 1
+
 #ifndef _SYS_PROCFS_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
@@ -48,3 +51,5 @@ typedef struct user_fpxregs_struct elf_fpxregset_t;
    floating-point stuff.  */
 typedef struct user_fpregs_struct elf_fpregset_t;
 #endif
+
+#endif /* bits/procfs.h */
index 852c8a019326120b876b6b6bb39cb0b3dd3cb156..519a78a799594aa72cb9b42419954f9ac933cd43 100644 (file)
@@ -25,6 +25,8 @@
 
 /* Define types required by the standard.  */
 #include <bits/types/size_t.h>
+#include <bits/types/pid_t.h>
+#include <bits/types/time_t.h>
 #ifdef __USE_GNU
 # include <bits/types/struct_timespec.h>
 #endif