From b32c5f35b8fb037bd54cde10bb14e6510171534a Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Tue, 21 May 2019 19:05:39 -0400 Subject: =?UTF-8?q?Don=E2=80=99t=20include=20sys/types.h=20or=20stdint.h?= =?UTF-8?q?=20from=20most=20public=20headers.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ). 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. --- bits/fcntl.h | 9 +- bits/sem.h | 7 +- bits/utmp.h | 32 +- bits/utmpx.h | 105 +++++++ elf/link.h | 2 +- gmon/sys/gmon.h | 2 - gmon/sys/profil.h | 4 +- gmon/tst-sprofil.c | 1 + include/net/if.h | 2 +- include/netinet/ether.h | 1 + include/netinet/in_systm.h | 1 + include/netinet/ip.h | 1 + include/netinet/tcp.h | 1 + include/sys/mtio.h | 1 + include/utmpx.h | 1 + inet/aliases.h | 4 +- inet/htonl.c | 3 +- inet/htons.c | 2 + inet/netinet/in_systm.h | 39 +++ inet/netinet/ip.h | 303 ++++++++++++++++++ inet/netinet/tcp.h | 349 +++++++++++++++++++++ io/fts.h | 5 +- io/ftw.h | 1 - io/sys/sendfile.h | 6 +- login/Makefile | 15 +- login/utmp.h | 15 +- login/utmpx.h | 129 ++++++++ misc/Makefile | 6 +- misc/sys/mtio.h | 273 ++++++++++++++++ misc/sys/uio.h | 5 +- misc/sys/xattr.h | 3 +- nss/nss.h | 6 +- nss/tst-nss-test4.c | 1 + posix/spawn.h | 5 +- resolv/bits/types/res_state.h | 12 +- rt/aio.h | 7 +- rt/mqueue.h | 8 +- scripts/check-obsolete-constructs.py | 62 +--- socket/net/if.h | 200 ++++++++++++ socket/sys/socket.h | 3 + stdlib/sys/random.h | 4 +- sysdeps/generic/net/if.h | 49 --- sysdeps/generic/netinet/in_systm.h | 40 --- sysdeps/generic/netinet/ip.h | 302 ------------------ sysdeps/generic/netinet/tcp.h | 107 ------- sysdeps/gnu/Makefile | 12 - sysdeps/gnu/bits/sem.h | 7 +- sysdeps/gnu/bits/utmpx.h | 106 ------- sysdeps/gnu/net/if.h | 204 ------------ sysdeps/gnu/netinet/tcp.h | 349 --------------------- sysdeps/gnu/sys/mtio.h | 276 ---------------- sysdeps/gnu/utmpx.h | 122 ------- sysdeps/mach/hurd/bits/fcntl.h | 11 +- sysdeps/mach/hurd/bits/socket.h | 2 +- sysdeps/mach/hurd/i386/Makefile | 35 --- sysdeps/mach/hurd/sendfile.c | 1 + sysdeps/nptl/proc_service.h | 3 + sysdeps/nptl/sys/procfs.h | 3 +- sysdeps/nptl/thread_db.h | 1 - sysdeps/posix/dl-fileid.h | 4 +- sysdeps/powerpc/sys/platform/ppc.h | 10 +- sysdeps/pthread/semaphore.h | 2 +- sysdeps/unix/sysv/linux/aarch64/bits/procfs.h | 13 +- sysdeps/unix/sysv/linux/alpha/bits/epoll.h | 5 + .../unix/sysv/linux/alpha/bits/procfs-prregset.h | 9 + sysdeps/unix/sysv/linux/alpha/bits/procfs.h | 8 +- sysdeps/unix/sysv/linux/alpha/sys/acct.h | 2 +- sysdeps/unix/sysv/linux/arm/bits/procfs.h | 9 +- sysdeps/unix/sysv/linux/bits/epoll.h | 5 + sysdeps/unix/sysv/linux/bits/sem.h | 7 +- sysdeps/unix/sysv/linux/bits/socket.h | 8 +- sysdeps/unix/sysv/linux/bits/uio-ext.h | 4 +- sysdeps/unix/sysv/linux/csky/bits/procfs.h | 5 + sysdeps/unix/sysv/linux/hppa/bits/epoll.h | 5 + sysdeps/unix/sysv/linux/hppa/bits/procfs.h | 5 + sysdeps/unix/sysv/linux/ia64/bits/procfs.h | 8 +- sysdeps/unix/sysv/linux/m68k/bits/procfs.h | 9 +- sysdeps/unix/sysv/linux/microblaze/bits/procfs.h | 9 +- sysdeps/unix/sysv/linux/microblaze/sys/user.h | 4 +- sysdeps/unix/sysv/linux/mips/bits/epoll.h | 5 + sysdeps/unix/sysv/linux/mips/bits/procfs.h | 5 + sysdeps/unix/sysv/linux/nios2/bits/procfs.h | 5 + sysdeps/unix/sysv/linux/powerpc/bits/ppc.h | 2 +- sysdeps/unix/sysv/linux/powerpc/bits/procfs.h | 20 +- sysdeps/unix/sysv/linux/powerpc/sys/user.h | 1 + sysdeps/unix/sysv/linux/riscv/bits/procfs.h | 8 + sysdeps/unix/sysv/linux/s390/bits/procfs.h | 7 + sysdeps/unix/sysv/linux/s390/bits/utmp.h | 41 +-- sysdeps/unix/sysv/linux/s390/bits/utmpx.h | 32 +- sysdeps/unix/sysv/linux/sh/bits/procfs.h | 5 + sysdeps/unix/sysv/linux/sparc/bits/epoll.h | 5 + sysdeps/unix/sysv/linux/sparc/bits/procfs.h | 7 +- sysdeps/unix/sysv/linux/sys/acct.h | 6 +- sysdeps/unix/sysv/linux/sys/epoll.h | 10 +- sysdeps/unix/sysv/linux/sys/eventfd.h | 5 +- sysdeps/unix/sysv/linux/sys/fanotify.h | 6 +- sysdeps/unix/sysv/linux/sys/fsuid.h | 2 +- sysdeps/unix/sysv/linux/sys/inotify.h | 11 +- sysdeps/unix/sysv/linux/sys/procfs.h | 6 +- sysdeps/unix/sysv/linux/sys/quota.h | 2 +- sysdeps/unix/sysv/linux/sys/raw.h | 7 +- sysdeps/unix/sysv/linux/sys/signalfd.h | 47 +-- sysdeps/unix/sysv/linux/x86/bits/epoll.h | 5 + sysdeps/unix/sysv/linux/x86/bits/procfs.h | 5 + sysvipc/sys/sem.h | 2 + 105 files changed, 1810 insertions(+), 1844 deletions(-) create mode 100644 bits/utmpx.h create mode 100644 include/netinet/in_systm.h create mode 100644 include/netinet/ip.h create mode 100644 include/netinet/tcp.h create mode 100644 include/sys/mtio.h create mode 100644 include/utmpx.h create mode 100644 inet/netinet/in_systm.h create mode 100644 inet/netinet/ip.h create mode 100644 inet/netinet/tcp.h create mode 100644 login/utmpx.h create mode 100644 misc/sys/mtio.h create mode 100644 socket/net/if.h delete mode 100644 sysdeps/generic/net/if.h delete mode 100644 sysdeps/generic/netinet/in_systm.h delete mode 100644 sysdeps/generic/netinet/ip.h delete mode 100644 sysdeps/generic/netinet/tcp.h delete mode 100644 sysdeps/gnu/bits/utmpx.h delete mode 100644 sysdeps/gnu/net/if.h delete mode 100644 sysdeps/gnu/netinet/tcp.h delete mode 100644 sysdeps/gnu/sys/mtio.h delete mode 100644 sysdeps/gnu/utmpx.h diff --git a/bits/fcntl.h b/bits/fcntl.h index a8278242e5..ad1b58f6d8 100644 --- a/bits/fcntl.h +++ b/bits/fcntl.h @@ -16,10 +16,14 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_FCNTL_H +#define _BITS_FCNTL_H 1 + #ifndef _FCNTL_H #error "Never use directly; include instead." #endif +#include /* File access modes for `open' and `fcntl'. */ #define O_RDONLY 0 /* Open read-only. */ @@ -104,9 +108,6 @@ /* File descriptor flags used with F_GETFD and F_SETFD. */ #define FD_CLOEXEC 1 /* Close on exec. */ - -#include - /* The structure describing an advisory lock. This is the type of the third argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ struct flock @@ -144,3 +145,5 @@ struct flock64 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +#endif diff --git a/bits/sem.h b/bits/sem.h index a84bfb1dd1..80615e7d8f 100644 --- a/bits/sem.h +++ b/bits/sem.h @@ -15,11 +15,14 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_SEM_H +#define _BITS_SEM_H 1 + #ifndef _SYS_SEM_H # error "Never include directly; use instead." #endif -#include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ @@ -58,3 +61,5 @@ struct semid_ds incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether one must define the union or not. */ #define _SEM_SEMUN_UNDEFINED 1 + +#endif /* bits/sem.h */ diff --git a/bits/utmp.h b/bits/utmp.h index b82d14536f..e8e88cc00f 100644 --- a/bits/utmp.h +++ b/bits/utmp.h @@ -16,13 +16,13 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_UTMP_H +#define _BITS_UTMP_H 1 + #ifndef _UTMP_H # error "Never include directly; use instead." #endif -#include -#include -#include #include @@ -36,7 +36,7 @@ struct lastlog { #if __WORDSIZE_TIME64_COMPAT32 - int32_t ll_time; + __int32_t ll_time; #else __time_t ll_time; #endif @@ -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 */ diff --git a/bits/utmpx.h b/bits/utmpx.h new file mode 100644 index 0000000000..b8f2e16a6f --- /dev/null +++ b/bits/utmpx.h @@ -0,0 +1,105 @@ +/* Structures and definitions for the user accounting database. GNU version. + Copyright (C) 1997-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 + . */ + +#ifndef _BITS_UTMPX_H +#define _BITS_UTMPX_H 1 + +#ifndef _UTMPX_H +# error "Never include directly; use instead." +#endif + +#define __UT_LINESIZE 32 +#define __UT_NAMESIZE 32 +#define __UT_HOSTSIZE 256 + + +/* The structure describing the status of a terminated process. This + type is used in `struct utmpx' below. */ +struct __exit_status + { +#ifdef __USE_GNU + short int e_termination; /* Process termination status. */ + short int e_exit; /* Process exit status. */ +#else + short int __e_termination; /* Process termination status. */ + short int __e_exit; /* Process exit status. */ +#endif + }; + + +/* The structure describing an entry in the user accounting database. */ +struct utmpx +{ + short int ut_type; /* Type of login. */ + __pid_t ut_pid; /* Process ID of login process. */ + char ut_line[__UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[__UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[__UT_HOSTSIZE] + __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. 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 + { + __int32_t tv_sec; /* Seconds. */ + __int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else + __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. */ +}; + + +/* Values for the `ut_type' field of a `struct utmpx'. */ +#define EMPTY 0 /* No valid user accounting information. */ + +#ifdef __USE_GNU +# define RUN_LVL 1 /* The system's runlevel. */ +#endif +#define BOOT_TIME 2 /* Time of system boot. */ +#define NEW_TIME 3 /* Time after system clock changed. */ +#define OLD_TIME 4 /* Time when system clock changed. */ + +#define INIT_PROCESS 5 /* Process spawned by the init process. */ +#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ +#define USER_PROCESS 7 /* Normal process. */ +#define DEAD_PROCESS 8 /* Terminated process. */ + +#ifdef __USE_GNU +# define ACCOUNTING 9 /* System accounting. */ +#endif + +#endif /* bits/utmpx.h */ diff --git a/elf/link.h b/elf/link.h index 0048ad5d4d..3f4c2cce53 100644 --- a/elf/link.h +++ b/elf/link.h @@ -23,7 +23,6 @@ #include #include #include -#include /* We use this macro to refer to ELF types independent of the native wordsize. `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */ @@ -31,6 +30,7 @@ #define _ElfW(e,w,t) _ElfW_1 (e, w, _##t) #define _ElfW_1(e,w,t) e##w##t +#include #include /* Defines __ELF_NATIVE_CLASS. */ #include diff --git a/gmon/sys/gmon.h b/gmon/sys/gmon.h index b4cc3b043a..5d7de0fe9b 100644 --- a/gmon/sys/gmon.h +++ b/gmon/sys/gmon.h @@ -34,8 +34,6 @@ #include -#include - /* * See gmon_out.h for gmon.out format. */ diff --git a/gmon/sys/profil.h b/gmon/sys/profil.h index 9f71e6d081..5a1ce09ac5 100644 --- a/gmon/sys/profil.h +++ b/gmon/sys/profil.h @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include /* This interface is intended to follow the sprofil() system calls as described by the sprofil(2) man page of Irix v6.5, except that: diff --git a/gmon/tst-sprofil.c b/gmon/tst-sprofil.c index 6663a97caf..93de84b5b4 100644 --- a/gmon/tst-sprofil.c +++ b/gmon/tst-sprofil.c @@ -20,6 +20,7 @@ #include #include #include +#include #include diff --git a/include/net/if.h b/include/net/if.h index 6c4cbc96c3..2e7af05ed2 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -1,6 +1,6 @@ #ifndef _NET_IF_H -# include_next +#include #ifndef _ISOMAC libc_hidden_proto (if_nametoindex) diff --git a/include/netinet/ether.h b/include/netinet/ether.h index 8bfe7e03ad..a60aa27240 100644 --- a/include/netinet/ether.h +++ b/include/netinet/ether.h @@ -2,6 +2,7 @@ #include # ifndef _ISOMAC +# include libc_hidden_proto (ether_aton_r) libc_hidden_proto (ether_ntoa_r) diff --git a/include/netinet/in_systm.h b/include/netinet/in_systm.h new file mode 100644 index 0000000000..7634c9b5a0 --- /dev/null +++ b/include/netinet/in_systm.h @@ -0,0 +1 @@ +#include diff --git a/include/netinet/ip.h b/include/netinet/ip.h new file mode 100644 index 0000000000..da55733e90 --- /dev/null +++ b/include/netinet/ip.h @@ -0,0 +1 @@ +#include diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h new file mode 100644 index 0000000000..edba529813 --- /dev/null +++ b/include/netinet/tcp.h @@ -0,0 +1 @@ +#include diff --git a/include/sys/mtio.h b/include/sys/mtio.h new file mode 100644 index 0000000000..f4861bda70 --- /dev/null +++ b/include/sys/mtio.h @@ -0,0 +1 @@ +#include diff --git a/include/utmpx.h b/include/utmpx.h new file mode 100644 index 0000000000..cfe9b7c054 --- /dev/null +++ b/include/utmpx.h @@ -0,0 +1 @@ +#include diff --git a/inet/aliases.h b/inet/aliases.h index b22ed63831..e868866baa 100644 --- a/inet/aliases.h +++ b/inet/aliases.h @@ -19,9 +19,7 @@ #define _ALIASES_H 1 #include - -#include - +#include __BEGIN_DECLS diff --git a/inet/htonl.c b/inet/htonl.c index e171273365..3eb174fb4b 100644 --- a/inet/htonl.c +++ b/inet/htonl.c @@ -15,8 +15,9 @@ License along with the GNU C Library; if not, see . */ -#include #include +#include +#include #undef htonl #undef ntohl diff --git a/inet/htons.c b/inet/htons.c index 9500e4cfb6..71d4861753 100644 --- a/inet/htons.c +++ b/inet/htons.c @@ -16,6 +16,8 @@ . */ #include +#include +#include #undef htons #undef ntohs diff --git a/inet/netinet/in_systm.h b/inet/netinet/in_systm.h new file mode 100644 index 0000000000..960f2af8fa --- /dev/null +++ b/inet/netinet/in_systm.h @@ -0,0 +1,39 @@ +/* System specific type definitions for networking code. + Copyright (C) 1997-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 + . */ + +#ifndef _NETINET_IN_SYSTM_H +#define _NETINET_IN_SYSTM_H 1 + +#include + +__BEGIN_DECLS + +/* + * Network order versions of various data types. Unfortunately, BSD + * assumes specific sizes for shorts (16 bit) and longs (32 bit) which + * don't hold in general. As a consequence, the network order versions + * may not reflect the actual size of the native data types. + */ + +typedef uint16_t n_short; /* short as received from the net */ +typedef uint32_t n_long; /* long as received from the net */ +typedef uint32_t n_time; /* ms since 00:00 GMT, byte rev */ + +__END_DECLS + +#endif /* netinet/in_systm.h */ diff --git a/inet/netinet/ip.h b/inet/netinet/ip.h new file mode 100644 index 0000000000..8dd7f6a40e --- /dev/null +++ b/inet/netinet/ip.h @@ -0,0 +1,303 @@ +/* Copyright (C) 1991-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 + . */ + +#ifndef __NETINET_IP_H +#define __NETINET_IP_H 1 + +#include + +#include +#include +#include + +__BEGIN_DECLS + +struct timestamp + { + uint8_t len; + uint8_t ptr; +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int flags:4; + unsigned int overflow:4; +#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned int overflow:4; + unsigned int flags:4; +#else +# error "Please fix " +#endif + uint32_t data[9]; + }; + +struct iphdr + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int version:4; +#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned int version:4; + unsigned int ihl:4; +#else +# error "Please fix " +#endif + uint8_t tos; + uint16_t tot_len; + uint16_t id; + uint16_t frag_off; + uint8_t ttl; + uint8_t protocol; + uint16_t check; + uint32_t saddr; + uint32_t daddr; + /*The options start here. */ + }; + +#ifdef __USE_MISC +/* + * 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. + * + * @(#)ip.h 8.1 (Berkeley) 6/10/93 + */ + +/* + * Definitions for internet protocol version 4. + * Per RFC 791, September 1981. + */ + +/* + * Structure of an internet header, naked of options. + */ +struct ip + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ip_hl:4; /* header length */ + unsigned int ip_v:4; /* version */ +#endif +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int ip_v:4; /* version */ + unsigned int ip_hl:4; /* header length */ +#endif + uint8_t ip_tos; /* type of service */ + unsigned short ip_len; /* total length */ + unsigned short ip_id; /* identification */ + unsigned short ip_off; /* fragment offset field */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + uint8_t ip_ttl; /* time to live */ + uint8_t ip_p; /* protocol */ + unsigned short ip_sum; /* checksum */ + struct in_addr ip_src, ip_dst; /* source and dest address */ + }; + +/* + * Time stamp option structure. + */ +struct ip_timestamp + { + uint8_t ipt_code; /* IPOPT_TS */ + uint8_t ipt_len; /* size of structure (variable) */ + uint8_t ipt_ptr; /* index of current entry */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ipt_flg:4; /* flags, see below */ + unsigned int ipt_oflw:4; /* overflow counter */ +#endif +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int ipt_oflw:4; /* overflow counter */ + unsigned int ipt_flg:4; /* flags, see below */ +#endif + uint32_t data[9]; + }; +#endif /* __USE_MISC */ + +#define IPVERSION 4 /* IP version number */ +#define IP_MAXPACKET 65535 /* maximum packet size */ + +/* + * Definitions for Explicit Congestion Notification (ECN) + * + * Taken from RFC-3168, Section 5. + */ + +#define IPTOS_ECN_MASK 0x03 +#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK) +#define IPTOS_ECN_NOT_ECT 0x00 +#define IPTOS_ECN_ECT1 0x01 +#define IPTOS_ECN_ECT0 0x02 +#define IPTOS_ECN_CE 0x03 + +/* + * Definitions for IP differentiated services code points (DSCP) + * + * Taken from RFC-2597, Section 6 and RFC-2598, Section 2.3. + */ + +#define IPTOS_DSCP_MASK 0xfc +#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK) +#define IPTOS_DSCP_AF11 0x28 +#define IPTOS_DSCP_AF12 0x30 +#define IPTOS_DSCP_AF13 0x38 +#define IPTOS_DSCP_AF21 0x48 +#define IPTOS_DSCP_AF22 0x50 +#define IPTOS_DSCP_AF23 0x58 +#define IPTOS_DSCP_AF31 0x68 +#define IPTOS_DSCP_AF32 0x70 +#define IPTOS_DSCP_AF33 0x78 +#define IPTOS_DSCP_AF41 0x88 +#define IPTOS_DSCP_AF42 0x90 +#define IPTOS_DSCP_AF43 0x98 +#define IPTOS_DSCP_EF 0xb8 + +/* + * In RFC 2474, Section 4.2.2.1, the Class Selector Codepoints subsume + * the old ToS Precedence values. + */ + +#define IPTOS_CLASS_MASK 0xe0 +#define IPTOS_CLASS(class) ((class) & IPTOS_CLASS_MASK) +#define IPTOS_CLASS_CS0 0x00 +#define IPTOS_CLASS_CS1 0x20 +#define IPTOS_CLASS_CS2 0x40 +#define IPTOS_CLASS_CS3 0x60 +#define IPTOS_CLASS_CS4 0x80 +#define IPTOS_CLASS_CS5 0xa0 +#define IPTOS_CLASS_CS6 0xc0 +#define IPTOS_CLASS_CS7 0xe0 + +#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0 + +/* + * Definitions for IP type of service (ip_tos) [deprecated; use DSCP + * and CS definitions above instead.] + */ +#define IPTOS_TOS_MASK 0x1E +#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 +#define IPTOS_LOWCOST 0x02 +#define IPTOS_MINCOST IPTOS_LOWCOST + +/* + * Definitions for IP precedence (also in ip_tos) [also deprecated.] + */ +#define IPTOS_PREC_MASK IPTOS_CLASS_MASK +#define IPTOS_PREC(tos) IPTOS_CLASS(tos) +#define IPTOS_PREC_NETCONTROL IPTOS_CLASS_CS7 +#define IPTOS_PREC_INTERNETCONTROL IPTOS_CLASS_CS6 +#define IPTOS_PREC_CRITIC_ECP IPTOS_CLASS_CS5 +#define IPTOS_PREC_FLASHOVERRIDE IPTOS_CLASS_CS4 +#define IPTOS_PREC_FLASH IPTOS_CLASS_CS3 +#define IPTOS_PREC_IMMEDIATE IPTOS_CLASS_CS2 +#define IPTOS_PREC_PRIORITY IPTOS_CLASS_CS1 +#define IPTOS_PREC_ROUTINE IPTOS_CLASS_CS0 + +/* + * Definitions for options. + */ +#define IPOPT_COPY 0x80 +#define IPOPT_CLASS_MASK 0x60 +#define IPOPT_NUMBER_MASK 0x1f + +#define IPOPT_COPIED(o) ((o) & IPOPT_COPY) +#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK) +#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK) + +#define IPOPT_CONTROL 0x00 +#define IPOPT_RESERVED1 0x20 +#define IPOPT_DEBMEAS 0x40 +#define IPOPT_MEASUREMENT IPOPT_DEBMEAS +#define IPOPT_RESERVED2 0x60 + +#define IPOPT_EOL 0 /* end of option list */ +#define IPOPT_END IPOPT_EOL +#define IPOPT_NOP 1 /* no operation */ +#define IPOPT_NOOP IPOPT_NOP + +#define IPOPT_RR 7 /* record packet route */ +#define IPOPT_TS 68 /* timestamp */ +#define IPOPT_TIMESTAMP IPOPT_TS +#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ +#define IPOPT_SEC IPOPT_SECURITY +#define IPOPT_LSRR 131 /* loose source route */ +#define IPOPT_SATID 136 /* satnet id */ +#define IPOPT_SID IPOPT_SATID +#define IPOPT_SSRR 137 /* strict source route */ +#define IPOPT_RA 148 /* router alert */ + +/* + * Offsets to fields in options other than EOL and NOP. + */ +#define IPOPT_OPTVAL 0 /* option ID */ +#define IPOPT_OLEN 1 /* option length */ +#define IPOPT_OFFSET 2 /* offset within option */ +#define IPOPT_MINOFF 4 /* min value of above */ + +#define MAX_IPOPTLEN 40 + +/* flag bits for ipt_flg */ +#define IPOPT_TS_TSONLY 0 /* timestamps only */ +#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ +#define IPOPT_TS_PRESPEC 3 /* specified modules only */ + +/* bits for security (not byte swapped) */ +#define IPOPT_SECUR_UNCLASS 0x0000 +#define IPOPT_SECUR_CONFID 0xf135 +#define IPOPT_SECUR_EFTO 0x789a +#define IPOPT_SECUR_MMMM 0xbc4d +#define IPOPT_SECUR_RESTR 0xaf13 +#define IPOPT_SECUR_SECRET 0xd788 +#define IPOPT_SECUR_TOPSECRET 0x6bc5 + +/* + * Internet implementation parameters. + */ +#define MAXTTL 255 /* maximum time to live (seconds) */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ +#define IPFRAGTTL 60 /* time to live for frags, slowhz */ +#define IPTTLDEC 1 /* subtracted when forwarding */ + +#define IP_MSS 576 /* default maximum segment size */ + +__END_DECLS + +#endif /* netinet/ip.h */ diff --git a/inet/netinet/tcp.h b/inet/netinet/tcp.h new file mode 100644 index 0000000000..243b55a24c --- /dev/null +++ b/inet/netinet/tcp.h @@ -0,0 +1,349 @@ +/* + * 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 + +/* + * User-settable options (used with setsockopt). + */ +#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ +#define TCP_MAXSEG 2 /* Set maximum segment size */ +#define TCP_CORK 3 /* Control sending of partial frames */ +#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ +#define TCP_KEEPINTVL 5 /* Interval between keepalives */ +#define TCP_KEEPCNT 6 /* Number of keepalives before death */ +#define TCP_SYNCNT 7 /* Number of SYN retransmits */ +#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ +#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ +#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ +#define TCP_INFO 11 /* Information about this connection. */ +#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ +#define TCP_CONGESTION 13 /* Congestion control algorithm. */ +#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ +#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ +#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ +#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ +#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ +#define TCP_REPAIR 19 /* TCP sock is under repair right now */ +#define TCP_REPAIR_QUEUE 20 /* Set TCP queue to repair */ +#define TCP_QUEUE_SEQ 21 /* Set sequence number of repaired queue. */ +#define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */ +#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ +#define TCP_TIMESTAMP 24 /* TCP time stamp */ +#define TCP_NOTSENT_LOWAT 25 /* Limit number of unsent bytes in + write queue. */ +#define TCP_CC_INFO 26 /* Get Congestion Control + (optional) info. */ +#define TCP_SAVE_SYN 27 /* Record SYN headers for new + connections. */ +#define TCP_SAVED_SYN 28 /* Get SYN headers recorded for + connection. */ +#define TCP_REPAIR_WINDOW 29 /* Get/set window parameters. */ +#define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect. */ +#define TCP_ULP 31 /* Attach a ULP to a TCP connection. */ +#define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions. */ +#define TCP_FASTOPEN_KEY 33 /* Set the key for Fast Open (cookie). */ +#define TCP_FASTOPEN_NO_COOKIE 34 /* Enable TFO without a TFO cookie. */ +#define TCP_ZEROCOPY_RECEIVE 35 +#define TCP_INQ 36 /* Notify bytes available to read + as a cmsg on read. */ +#define TCP_CM_INQ TCP_INQ +#define TCP_TX_DELAY 37 /* Delay outgoing packets by XX usec. */ + +#define TCP_REPAIR_ON 1 +#define TCP_REPAIR_OFF 0 +#define TCP_REPAIR_OFF_NO_WP -1 + +#ifdef __USE_MISC +# include +# include +# include + +typedef uint32_t tcp_seq; +/* + * TCP header. + * Per RFC 793, September, 1981. + */ +struct tcphdr + { + __extension__ union + { + struct + { + uint16_t th_sport; /* source port */ + uint16_t th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ +# if __BYTE_ORDER == __LITTLE_ENDIAN + uint8_t th_x2:4; /* (unused) */ + uint8_t th_off:4; /* data offset */ +# endif +# if __BYTE_ORDER == __BIG_ENDIAN + uint8_t th_off:4; /* data offset */ + uint8_t th_x2:4; /* (unused) */ +# endif + uint8_t 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 + uint16_t th_win; /* window */ + uint16_t th_sum; /* checksum */ + uint16_t th_urp; /* urgent pointer */ + }; + struct + { + uint16_t source; + uint16_t dest; + uint32_t seq; + uint32_t ack_seq; +# if __BYTE_ORDER == __LITTLE_ENDIAN + uint16_t res1:4; + uint16_t doff:4; + uint16_t fin:1; + uint16_t syn:1; + uint16_t rst:1; + uint16_t psh:1; + uint16_t ack:1; + uint16_t urg:1; + uint16_t res2:2; +# elif __BYTE_ORDER == __BIG_ENDIAN + uint16_t doff:4; + uint16_t res1:4; + uint16_t res2:2; + uint16_t urg:1; + uint16_t ack:1; + uint16_t psh:1; + uint16_t rst:1; + uint16_t syn:1; + uint16_t fin:1; +# else +# error "Adjust your defines" +# endif + uint16_t window; + uint16_t check; + uint16_t urg_ptr; + }; + }; +}; + +enum +{ + TCP_ESTABLISHED = 1, + TCP_SYN_SENT, + TCP_SYN_RECV, + TCP_FIN_WAIT1, + TCP_FIN_WAIT2, + TCP_TIME_WAIT, + TCP_CLOSE, + TCP_CLOSE_WAIT, + TCP_LAST_ACK, + TCP_LISTEN, + TCP_CLOSING /* now a valid state */ +}; + +# 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 */ + +# define SOL_TCP 6 /* TCP level */ + + +# define TCPI_OPT_TIMESTAMPS 1 +# define TCPI_OPT_SACK 2 +# define TCPI_OPT_WSCALE 4 +# define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ +# define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ +# define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ + +/* Values for tcpi_state. */ +enum tcp_ca_state +{ + TCP_CA_Open = 0, + TCP_CA_Disorder = 1, + TCP_CA_CWR = 2, + TCP_CA_Recovery = 3, + TCP_CA_Loss = 4 +}; + +struct tcp_info +{ + uint8_t tcpi_state; + uint8_t tcpi_ca_state; + uint8_t tcpi_retransmits; + uint8_t tcpi_probes; + uint8_t tcpi_backoff; + uint8_t tcpi_options; + uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; + + uint32_t tcpi_rto; + uint32_t tcpi_ato; + uint32_t tcpi_snd_mss; + uint32_t tcpi_rcv_mss; + + uint32_t tcpi_unacked; + uint32_t tcpi_sacked; + uint32_t tcpi_lost; + uint32_t tcpi_retrans; + uint32_t tcpi_fackets; + + /* Times. */ + uint32_t tcpi_last_data_sent; + uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ + uint32_t tcpi_last_data_recv; + uint32_t tcpi_last_ack_recv; + + /* Metrics. */ + uint32_t tcpi_pmtu; + uint32_t tcpi_rcv_ssthresh; + uint32_t tcpi_rtt; + uint32_t tcpi_rttvar; + uint32_t tcpi_snd_ssthresh; + uint32_t tcpi_snd_cwnd; + uint32_t tcpi_advmss; + uint32_t tcpi_reordering; + + uint32_t tcpi_rcv_rtt; + uint32_t tcpi_rcv_space; + + uint32_t tcpi_total_retrans; +}; + + +/* For TCP_MD5SIG socket option. */ +#define TCP_MD5SIG_MAXKEYLEN 80 + +/* tcp_md5sig extension flags for TCP_MD5SIG_EXT. */ +#define TCP_MD5SIG_FLAG_PREFIX 1 /* Address prefix length. */ + +struct tcp_md5sig +{ + struct sockaddr_storage tcpm_addr; /* Address associated. */ + uint8_t tcpm_flags; /* Extension flags. */ + uint8_t tcpm_prefixlen; /* Address prefix. */ + uint16_t tcpm_keylen; /* Key length. */ + uint32_t __tcpm_pad; /* Zero. */ + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */ +}; + +/* For socket repair options. */ +struct tcp_repair_opt +{ + uint32_t opt_code; + uint32_t opt_val; +}; + +/* Queue to repair, for TCP_REPAIR_QUEUE. */ +enum +{ + TCP_NO_QUEUE, + TCP_RECV_QUEUE, + TCP_SEND_QUEUE, + TCP_QUEUES_NR, +}; + +/* For cookie transactions socket options. */ +#define TCP_COOKIE_MIN 8 /* 64-bits */ +#define TCP_COOKIE_MAX 16 /* 128-bits */ +#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX) + +/* Flags for both getsockopt and setsockopt */ +#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */ +#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies, + * supercedes everything. */ + +/* Flags for getsockopt */ +#define TCP_S_DATA_IN (1 << 2) /* Was data received? */ +#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */ + +#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */ +#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */ + +struct tcp_cookie_transactions +{ + uint16_t tcpct_flags; + uint8_t __tcpct_pad1; + uint8_t tcpct_cookie_desired; + uint16_t tcpct_s_data_desired; + uint16_t tcpct_used; + uint8_t tcpct_value[TCP_MSS_DEFAULT]; +}; + +/* For use with TCP_REPAIR_WINDOW. */ +struct tcp_repair_window +{ + uint32_t snd_wl1; + uint32_t snd_wnd; + uint32_t max_window; + uint32_t rcv_wnd; + uint32_t rcv_wup; +}; + +/* For use with TCP_ZEROCOPY_RECEIVE. */ +struct tcp_zerocopy_receive +{ + uint64_t address; /* In: address of mapping. */ + uint32_t length; /* In/out: number of bytes to map/mapped. */ + uint32_t recv_skip_hint; /* Out: amount of bytes to skip. */ +}; + +#endif /* Misc. */ + +#endif /* netinet/tcp.h */ diff --git a/io/fts.h b/io/fts.h index 3e2d18403d..811ceff306 100644 --- a/io/fts.h +++ b/io/fts.h @@ -51,8 +51,11 @@ #define _FTS_H 1 #include -#include +#include +#include +#include +#include typedef struct { struct _ftsent *fts_cur; /* current node */ diff --git a/io/ftw.h b/io/ftw.h index 8cf9df1755..6e56129c45 100644 --- a/io/ftw.h +++ b/io/ftw.h @@ -24,7 +24,6 @@ #include -#include #include diff --git a/io/sys/sendfile.h b/io/sys/sendfile.h index e11cbc4219..130a79171a 100644 --- a/io/sys/sendfile.h +++ b/io/sys/sendfile.h @@ -20,7 +20,11 @@ #define _SYS_SENDFILE_H 1 #include -#include + +#include +#include +#include +#include __BEGIN_DECLS diff --git a/login/Makefile b/login/Makefile index d897057bbd..b4cc2069d4 100644 --- a/login/Makefile +++ b/login/Makefile @@ -23,12 +23,15 @@ subdir := login include ../Makeconfig -headers := utmp.h bits/utmp.h lastlog.h pty.h - -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)"' diff --git a/login/utmp.h b/login/utmp.h index 3de2b8596b..fa473df3df 100644 --- a/login/utmp.h +++ b/login/utmp.h @@ -20,21 +20,26 @@ #include -#include - - -__BEGIN_DECLS +/* utmp.h is not standardized; utmpx.h is, and is required to define + pid_t and struct timeval. It makes sense for utmp.h to be + consistent. */ +#include +#include +#include +#include +#include /* Get system dependent values and data structures. */ #include /* Compatibility names for the strings of the canonical file names. */ +#include #define UTMP_FILE _PATH_UTMP #define UTMP_FILENAME _PATH_UTMP #define WTMP_FILE _PATH_WTMP #define WTMP_FILENAME _PATH_WTMP - +__BEGIN_DECLS /* Make FD be the controlling terminal, stdin, stdout, and stderr; then close FD. Returns 0 on success, nonzero on error. */ diff --git a/login/utmpx.h b/login/utmpx.h new file mode 100644 index 0000000000..6394138713 --- /dev/null +++ b/login/utmpx.h @@ -0,0 +1,129 @@ +/* Copyright (C) 1997-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 + . */ + +#ifndef _UTMPX_H +#define _UTMPX_H 1 + +#include + +/* Required according to Unix98. */ +#include +#include +#include +#include +#include + +/* Get system dependent values and data structures. */ +#include + +#ifdef __USE_GNU +# include +# define _PATH_UTMPX _PATH_UTMP +# define _PATH_WTMPX _PATH_WTMP + +/* Compatibility names for the strings of the canonical file names. */ +# define UTMPX_FILE _PATH_UTMPX +# define UTMPX_FILENAME _PATH_UTMPX +# define WTMPX_FILE _PATH_WTMPX +# define WTMPX_FILENAME _PATH_WTMPX +#endif + +/* For the getutmp{,x} functions we need the `struct utmp'. */ +#ifdef __USE_GNU +struct utmp; +#endif + + +__BEGIN_DECLS + +/* Open user accounting database. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern void setutxent (void); + +/* Close user accounting database. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern void endutxent (void); + +/* Get the next entry from the user accounting database. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct utmpx *getutxent (void); + +/* Get the user accounting database entry corresponding to ID. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct utmpx *getutxid (const struct utmpx *__id); + +/* Get the user accounting database entry corresponding to LINE. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct utmpx *getutxline (const struct utmpx *__line); + +/* Write the entry UTMPX into the user accounting database. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct utmpx *pututxline (const struct utmpx *__utmpx); + + +#ifdef __USE_GNU +/* Change name of the utmpx file to be examined. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern int utmpxname (const char *__file); + +/* Append entry UTMP to the wtmpx-like file WTMPX_FILE. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern void updwtmpx (const char *__wtmpx_file, + const struct utmpx *__utmpx); + + +/* Copy the information in UTMPX to UTMP. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern void getutmp (const struct utmpx *__utmpx, + struct utmp *__utmp); + +/* Copy the information in UTMP to UTMPX. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern void getutmpx (const struct utmp *__utmp, struct utmpx *__utmpx); +#endif + +__END_DECLS + +#endif /* utmpx.h */ diff --git a/misc/Makefile b/misc/Makefile index a25146d332..3edb93ef8c 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -36,9 +36,9 @@ headers := \ bits/uio-ext.h bits/uio_lim.h bits/xopen_lim.h \ gnu/libc-version.h \ sys/auxv.h sys/cdefs.h sys/dir.h sys/file.h sys/ioctl.h \ - sys/mman.h sys/param.h sys/ptrace.h sys/queue.h sys/reboot.h \ - sys/select.h sys/swap.h sys/syscall.h sys/sysinfo.h \ - sys/syslog.h sys/sysmacros.h sys/uio.h sys/xattr.h + sys/mman.h sys/mtio.h sys/param.h sys/ptrace.h sys/queue.h \ + sys/reboot.h sys/select.h sys/swap.h sys/syscall.h \ + sys/sysinfo.h sys/syslog.h sys/sysmacros.h sys/uio.h sys/xattr.h routines := brk sbrk sstk ioctl \ readv writev preadv preadv64 pwritev pwritev64 \ diff --git a/misc/sys/mtio.h b/misc/sys/mtio.h new file mode 100644 index 0000000000..a36a256c53 --- /dev/null +++ b/misc/sys/mtio.h @@ -0,0 +1,273 @@ +/* Structures and definitions for magnetic tape I/O control commands. + Copyright (C) 1996-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 + . */ + +/* Written by H. Bergman . */ + +#ifndef _SYS_MTIO_H +#define _SYS_MTIO_H 1 + +#include + +/* Structure for MTIOCTOP - magnetic tape operation command. */ +struct mtop + { + short int mt_op; /* Operations defined below. */ + int mt_count; /* How many of them. */ + }; +#define _IOT_mtop /* Hurd ioctl type field. */ \ + _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0) + +/* Magnetic Tape operations [Not all operations supported by all drivers]. */ +#define MTRESET 0 /* +reset drive in case of problems. */ +#define MTFSF 1 /* Forward space over FileMark, + * position at first record of next file. */ +#define MTBSF 2 /* Backward space FileMark (position before FM). */ +#define MTFSR 3 /* Forward space record. */ +#define MTBSR 4 /* Backward space record. */ +#define MTWEOF 5 /* Write an end-of-file record (mark). */ +#define MTREW 6 /* Rewind. */ +#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */ +#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */ +#define MTRETEN 9 /* Retension tape. */ +#define MTBSFM 10 /* +backward space FileMark, position at FM. */ +#define MTFSFM 11 /* +forward space FileMark, position at FM. */ +#define MTEOM 12 /* Goto end of recorded media (for appending files). + MTEOM positions after the last FM, ready for + appending another file. */ +#define MTERASE 13 /* Erase tape -- be careful! */ + +#define MTRAS1 14 /* Run self test 1 (nondestructive). */ +#define MTRAS2 15 /* Run self test 2 (destructive). */ +#define MTRAS3 16 /* Reserved for self test 3. */ + +#define MTSETBLK 20 /* Set block length (SCSI). */ +#define MTSETDENSITY 21 /* Set tape density (SCSI). */ +#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */ +#define MTTELL 23 /* Tell block (Tandberg, etc.). */ +#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2. + Ordinary buffered operation with code 1. */ +#define MTFSS 25 /* Space forward over setmarks. */ +#define MTBSS 26 /* Space backward over setmarks. */ +#define MTWSM 27 /* Write setmarks. */ + +#define MTLOCK 28 /* Lock the drive door. */ +#define MTUNLOCK 29 /* Unlock the drive door. */ +#define MTLOAD 30 /* Execute the SCSI load command. */ +#define MTUNLOAD 31 /* Execute the SCSI unload command. */ +#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */ +#define MTSETPART 33 /* Change the active tape partition. */ +#define MTMKPART 34 /* Format the tape with one or two partitions. */ + +/* structure for MTIOCGET - mag tape get status command */ + +struct mtget + { + long int mt_type; /* Type of magtape device. */ + long int mt_resid; /* Residual count: (not sure) + number of bytes ignored, or + number of files not skipped, or + number of records not skipped. */ + /* The following registers are device dependent. */ + long int mt_dsreg; /* Status register. */ + long int mt_gstat; /* Generic (device independent) status. */ + long int mt_erreg; /* Error register. */ + /* The next two fields are not always used. */ + int mt_fileno; /* Number of current file on tape. */ + int mt_blkno; /* Current block number. */ + }; +#define _IOT_mtget /* Hurd ioctl type field. */ \ + _IOT (_IOTS (long), 7, 0, 0, 0, 0) + + +/* Constants for mt_type. Not all of these are supported, and + these are not all of the ones that are supported. */ +#define MT_ISUNKNOWN 0x01 +#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */ +#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */ +#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */ +#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */ +#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */ +#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */ +#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */ +#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */ +#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */ +#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */ +#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */ +#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, + Teac DC-1 card (Wangtek type). */ +#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */ +#define MT_ISDDS1 0x51 /* DDS device without partitions. */ +#define MT_ISDDS2 0x52 /* DDS device with partitions. */ +#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */ +#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */ + +/* QIC-40/80/3010/3020 ftape supported drives. + 20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */ +#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */ +#define MT_ISFTAPE_FLAG 0x800000 + +struct mt_tape_info + { + long int t_type; /* Device type id (mt_type). */ + char *t_name; /* Descriptive name. */ + }; + +#define MT_TAPE_INFO \ + { \ + {MT_ISUNKNOWN, "Unknown type of tape device"}, \ + {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \ + {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \ + {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \ + {MT_ISCMSJ500, "CMS Jumbo 500"}, \ + {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \ + {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \ + {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \ + {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \ + {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \ + {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \ + {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \ + {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \ + {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \ + {MT_ISSCSI1, "Generic SCSI-1 tape"}, \ + {MT_ISSCSI2, "Generic SCSI-2 tape"}, \ + {0, NULL} \ + } + + +/* Structure for MTIOCPOS - mag tape get position command. */ + +struct mtpos + { + long int mt_blkno; /* Current block number. */ + }; +#define _IOT_mtpos /* Hurd ioctl type field. */ \ + _IOT_SIMPLE (long) + + +/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended + as an interim solution for QIC-02 until DDI is fully implemented. */ +struct mtconfiginfo + { + long int mt_type; /* Drive type. */ + long int ifc_type; /* Interface card type. */ + unsigned short int irqnr; /* IRQ number to use. */ + unsigned short int dmanr; /* DMA channel to use. */ + unsigned short int port; /* IO port base address. */ + + unsigned long int debug; /* Debugging flags. */ + + unsigned have_dens:1; + unsigned have_bsf:1; + unsigned have_fsr:1; + unsigned have_bsr:1; + unsigned have_eod:1; + unsigned have_seek:1; + unsigned have_tell:1; + unsigned have_ras1:1; + unsigned have_ras2:1; + unsigned have_ras3:1; + unsigned have_qfa:1; + + unsigned pad1:5; + char reserved[10]; + }; +#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \ + _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */ + + +/* Magnetic tape I/O control commands. */ +#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */ +#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */ +#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/ + +/* The next two are used by the QIC-02 driver for runtime reconfiguration. + See tpqic02.h for struct mtconfiginfo. */ +#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/ +#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/ + +/* Generic Mag Tape (device independent) status macros for examining + mt_gstat -- HP-UX compatible. + There is room for more generic status bits here, but I don't + know which of them are reserved. At least three or so should + be added to make this really useful. */ +#define GMT_EOF(x) ((x) & 0x80000000) +#define GMT_BOT(x) ((x) & 0x40000000) +#define GMT_EOT(x) ((x) & 0x20000000) +#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */ +#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */ +#define GMT_WR_PROT(x) ((x) & 0x04000000) +/* #define GMT_ ? ((x) & 0x02000000) */ +#define GMT_ONLINE(x) ((x) & 0x01000000) +#define GMT_D_6250(x) ((x) & 0x00800000) +#define GMT_D_1600(x) ((x) & 0x00400000) +#define GMT_D_800(x) ((x) & 0x00200000) +/* #define GMT_ ? ((x) & 0x00100000) */ +/* #define GMT_ ? ((x) & 0x00080000) */ +#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */ +/* #define GMT_ ? ((x) & 0x00020000) */ +#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/ +/* 16 generic status bits unused. */ + + +/* SCSI-tape specific definitions. Bitfield shifts in the status */ +#define MT_ST_BLKSIZE_SHIFT 0 +#define MT_ST_BLKSIZE_MASK 0xffffff +#define MT_ST_DENSITY_SHIFT 24 +#define MT_ST_DENSITY_MASK 0xff000000 + +#define MT_ST_SOFTERR_SHIFT 0 +#define MT_ST_SOFTERR_MASK 0xffff + +/* Bitfields for the MTSETDRVBUFFER ioctl. */ +#define MT_ST_OPTIONS 0xf0000000 +#define MT_ST_BOOLEANS 0x10000000 +#define MT_ST_SETBOOLEANS 0x30000000 +#define MT_ST_CLEARBOOLEANS 0x40000000 +#define MT_ST_WRITE_THRESHOLD 0x20000000 +#define MT_ST_DEF_BLKSIZE 0x50000000 +#define MT_ST_DEF_OPTIONS 0x60000000 + +#define MT_ST_BUFFER_WRITES 0x1 +#define MT_ST_ASYNC_WRITES 0x2 +#define MT_ST_READ_AHEAD 0x4 +#define MT_ST_DEBUGGING 0x8 +#define MT_ST_TWO_FM 0x10 +#define MT_ST_FAST_MTEOM 0x20 +#define MT_ST_AUTO_LOCK 0x40 +#define MT_ST_DEF_WRITES 0x80 +#define MT_ST_CAN_BSR 0x100 +#define MT_ST_NO_BLKLIMS 0x200 +#define MT_ST_CAN_PARTITIONS 0x400 +#define MT_ST_SCSI2LOGICAL 0x800 + +/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */ +#define MT_ST_CLEAR_DEFAULT 0xfffff +#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000) +#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000) +#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000) + +/* The offset for the arguments for the special HP changer load command. */ +#define MT_ST_HPLOADER_OFFSET 10000 + + +/* Specify default tape device. */ +#ifndef DEFTAPE +# define DEFTAPE "/dev/tape" +#endif + +#endif /* mtio.h */ diff --git a/misc/sys/uio.h b/misc/sys/uio.h index 26d87c9f34..6847998f6c 100644 --- a/misc/sys/uio.h +++ b/misc/sys/uio.h @@ -19,7 +19,10 @@ #define _SYS_UIO_H 1 #include -#include + +#include +#include +#include #include #include #ifdef __IOV_MAX diff --git a/misc/sys/xattr.h b/misc/sys/xattr.h index e3a43c1ea2..8061587497 100644 --- a/misc/sys/xattr.h +++ b/misc/sys/xattr.h @@ -19,8 +19,9 @@ #define _SYS_XATTR_H 1 #include -#include +#include +#include __BEGIN_DECLS diff --git a/nss/nss.h b/nss/nss.h index 390ea34aaf..a024fd7a06 100644 --- a/nss/nss.h +++ b/nss/nss.h @@ -22,7 +22,7 @@ #define _NSS_H 1 #include -#include +#include __BEGIN_DECLS @@ -44,8 +44,8 @@ struct gaih_addrtuple struct gaih_addrtuple *next; char *name; int family; - uint32_t addr[4]; - uint32_t scopeid; + __uint32_t addr[4]; + __uint32_t scopeid; }; diff --git a/nss/tst-nss-test4.c b/nss/tst-nss-test4.c index e9062eec2e..45581fc3df 100644 --- a/nss/tst-nss-test4.c +++ b/nss/tst-nss-test4.c @@ -20,6 +20,7 @@ #include #include #include +#include #include diff --git a/posix/spawn.h b/posix/spawn.h index be6bd591a3..a51541918c 100644 --- a/posix/spawn.h +++ b/posix/spawn.h @@ -21,7 +21,10 @@ #include #include -#include + +#include +#include +#include #include diff --git a/resolv/bits/types/res_state.h b/resolv/bits/types/res_state.h index 2544a627f6..81febe13b0 100644 --- a/resolv/bits/types/res_state.h +++ b/resolv/bits/types/res_state.h @@ -1,7 +1,7 @@ #ifndef __res_state_defined #define __res_state_defined 1 -#include +#include #include /* res_state: the global state used by the resolver stub. */ @@ -28,7 +28,7 @@ struct __res_state { unsigned unused:23; struct { struct in_addr addr; - uint32_t mask; + __uint32_t mask; } sort_list[MAXRESOLVSORT]; /* 4 byte hole here on 64-bit architectures. */ void * __glibc_unused_qhook; @@ -40,11 +40,11 @@ struct __res_state { union { char pad[52]; /* On an i386 this means 512b total. */ struct { - uint16_t nscount; - uint16_t nsmap[MAXNS]; + __uint16_t nscount; + __uint16_t nsmap[MAXNS]; int nssocks[MAXNS]; - uint16_t nscount6; - uint16_t nsinit; + __uint16_t nscount6; + __uint16_t nsinit; struct sockaddr_in6 *nsaddrs[MAXNS]; #ifdef _LIBC unsigned long long int __glibc_extension_index diff --git a/rt/aio.h b/rt/aio.h index 2bbcc6adc7..87827f1888 100644 --- a/rt/aio.h +++ b/rt/aio.h @@ -23,7 +23,12 @@ #define _AIO_H 1 #include -#include + +#include +#include +#include +#include +#include #include #include #include diff --git a/rt/mqueue.h b/rt/mqueue.h index a2a2aa1771..b96a2ab573 100644 --- a/rt/mqueue.h +++ b/rt/mqueue.h @@ -19,13 +19,19 @@ #define _MQUEUE_H 1 #include -#include #include + +#include +#include #include +#include +#include #include + /* Get the definition of mqd_t and struct mq_attr. */ #include + __BEGIN_DECLS /* Establish connection between a process and a message queue NAME and diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py index 511c13d6a6..1a0e91cf63 100755 --- a/scripts/check-obsolete-constructs.py +++ b/scripts/check-obsolete-constructs.py @@ -515,16 +515,15 @@ HEADER_ALLOWED_INCLUDES = { # mqueue.h -> fcntl.h # sched.h -> time.h # spawn.h -> sched.h - "aio.h": [ "sys/types.h" ], - "ftw.h": [ "sys/stat.h", "sys/types.h" ], + "ftw.h": [ "sys/stat.h" ], "langinfo.h": [ "nl_types.h" ], - "mqueue.h": [ "fcntl.h", "sys/types.h" ], + "mqueue.h": [ "fcntl.h" ], "pthread.h": [ "sched.h", "time.h" ], "regex.h": [ "limits.h", "sys/types.h" ], "sched.h": [ "time.h" ], - "semaphore.h": [ "sys/types.h" ], - "spawn.h": [ "sched.h", "sys/types.h" ], + "spawn.h": [ "sched.h" ], "termios.h": [ "sys/ttydefaults.h" ], + "utmpx.h": [ "paths.h" ], # POSIX sys/ headers # mandated: sys/msg.h -> sys/ipc.h @@ -538,77 +537,54 @@ HEADER_ALLOWED_INCLUDES = { # necessary for backward compatibility with BSD "sys/types.h": [ "endian.h" ], - "sys/uio.h": [ "sys/types.h" ], - # POSIX networking headers # allowed: netdb.h -> netinet/in.h # arpa/inet.h -> netinet/in.h "netdb.h": [ "netinet/in.h", "rpc/netdb.h" ], "arpa/inet.h": [ "netinet/in.h" ], - "net/if.h": [ "sys/socket.h", "sys/types.h" ], + "net/if.h": [ "sys/socket.h" ], "netinet/in.h": [ "sys/socket.h" ], - "netinet/tcp.h": [ "stdint.h", "sys/socket.h", - "sys/types.h" ], + "netinet/tcp.h": [ "sys/socket.h" ], # Nonstandardized top-level headers - "aliases.h": [ "sys/types.h" ], "argp.h": [ "ctype.h", "errno.h", "getopt.h", "limits.h", "stdio.h" ], "argz.h": [ "errno.h", "string.h" ], "elf.h": [ "stdint.h" ], "envz.h": [ "argz.h", "errno.h" ], - "fts.h": [ "sys/types.h" ], "gshadow.h": [ "paths.h" ], "ieee754.h": [ "float.h" ], "lastlog.h": [ "utmp.h" ], "libintl.h": [ "locale.h" ], - "link.h": [ "dlfcn.h", "elf.h", "sys/types.h" ], + "link.h": [ "dlfcn.h", "elf.h" ], "mntent.h": [ "paths.h" ], - "nss.h": [ "stdint.h" ], "obstack.h": [ "stddef.h", "string.h" ], "proc_service.h": [ "sys/procfs.h" ], "pty.h": [ "sys/ioctl.h", "termios.h" ], "sgtty.h": [ "sys/ioctl.h" ], "shadow.h": [ "paths.h" ], "stdio_ext.h": [ "stdio.h" ], - "thread_db.h": [ "pthread.h", "stdint.h", "sys/procfs.h", - "sys/types.h" ], + "thread_db.h": [ "pthread.h", "stdint.h", "sys/procfs.h" ], "ucontext.h": [ "sys/ucontext.h" ], - "utmp.h": [ "sys/types.h" ], - "utmpx.h": [ "sys/time.h" ], + "utmp.h": [ "paths.h" ], "values.h": [ "float.h", "limits.h" ], # Nonstandardized sys/ headers - "sys/acct.h": [ "endian.h", "stdint.h", "sys/types.h" ], "sys/auxv.h": [ "elf.h" ], "sys/elf.h": [ "sys/procfs.h" ], - "sys/epoll.h": [ "stdint.h", "sys/types.h" ], - "sys/eventfd.h": [ "stdint.h" ], - "sys/fanotify.h": [ "stdint.h" ], "sys/file.h": [ "fcntl.h" ], - "sys/fsuid.h": [ "sys/types.h" ], - "sys/gmon.h": [ "sys/types.h" ], - "sys/inotify.h": [ "stdint.h" ], "sys/ioctl.h": [ "sys/ttydefaults.h" ], "sys/mount.h": [ "sys/ioctl.h" ], - "sys/mtio.h": [ "sys/ioctl.h", "sys/types.h" ], + "sys/mtio.h": [ "sys/ioctl.h" ], "sys/param.h": [ "endian.h", "limits.h", "sys/types.h" ], - "sys/platform/ppc.h": [ "stdint.h" ], - "sys/procfs.h": [ "sys/time.h", "sys/types.h", - "sys/user.h" ], - "sys/profil.h": [ "sys/time.h", "sys/types.h" ], + "sys/procfs.h": [ "sys/ucontext.h", "sys/user.h" ], "sys/ptrace.h": [ "sys/ucontext.h" ], - "sys/quota.h": [ "sys/types.h" ], - "sys/random.h": [ "sys/types.h" ], - "sys/raw.h": [ "stdint.h", "sys/ioctl.h" ], - "sys/sendfile.h": [ "sys/types.h" ], - "sys/signalfd.h": [ "stdint.h" ], + "sys/raw.h": [ "sys/ioctl.h" ], "sys/socketvar.h": [ "sys/socket.h" ], "sys/timerfd.h": [ "time.h" ], "sys/ttychars.h": [ "sys/ttydefaults.h" ], "sys/ucontext.h": [ "sys/procfs.h" ], "sys/vfs.h": [ "sys/statfs.h" ], - "sys/xattr.h": [ "sys/types.h" ], # Nonstandardized headers that do nothing but include some other # header(s). These exist for compatibility with old systems where @@ -656,8 +632,7 @@ HEADER_ALLOWED_INCLUDES = { "netinet/if_fddi.h": [ "stdint.h", "sys/types.h" ], "netinet/if_tr.h": [ "stdint.h", "sys/types.h" ], "netinet/igmp.h": [ "netinet/in.h", "sys/types.h" ], - "netinet/in_systm.h": [ "stdint.h", "sys/types.h" ], - "netinet/ip.h": [ "netinet/in.h", "sys/types.h" ], + "netinet/ip.h": [ "netinet/in.h" ], "netinet/ip6.h": [ "inttypes.h", "netinet/in.h" ], "netinet/ip_icmp.h": [ "netinet/in.h", "netinet/ip.h", "stdint.h", "sys/types.h" ], @@ -675,14 +650,8 @@ HEADER_ALLOWED_INCLUDES = { "features.h": [ "gnu/stubs.h", "stdc-predef.h", "sys/cdefs.h" ], - "bits/fcntl.h": [ "sys/types.h" ], - "bits/ipc.h": [ "sys/types.h" ], "bits/procfs.h": [ "signal.h", "sys/ucontext.h" ], - "bits/sem.h": [ "sys/types.h" ], - "bits/socket.h": [ "sys/types.h" ], - "bits/types/res_state.h": [ "netinet/in.h", "sys/types.h" ], - "bits/utmp.h": [ "paths.h", "sys/time.h", "sys/types.h" ], - "bits/utmpx.h": [ "paths.h", "sys/time.h" ], + "bits/types/res_state.h": [ "netinet/in.h" ], "bits/types/__va_list.h": [ "stdarg.h" ], "bits/types/ptrdiff_t.h": [ "stddef.h" ], @@ -730,7 +699,8 @@ SYSDEP_ALLOWED_INCLUDES = { "bits/ioctls.h": [ "asm/ioctls.h", "linux/sockios.h" ], "bits/local_lim.h": [ "linux/limits.h" ], "bits/param.h": [ "linux/limits.h", "linux/param.h" ], - "bits/procfs.h": [ "asm/ptrace.h" ], + "bits/procfs.h": [ "asm/elf.h", "asm/ptrace.h" ], + "bits/procfs-prregset.h": [ "sys/ucontext.h" ], "bits/sigcontext.h": [ "asm/sigcontext.h" ], "bits/socket.h": [ "asm/socket.h" ], }, diff --git a/socket/net/if.h b/socket/net/if.h new file mode 100644 index 0000000000..8431e000a2 --- /dev/null +++ b/socket/net/if.h @@ -0,0 +1,200 @@ +/* net/if.h -- declarations for inquiring about network interfaces + Copyright (C) 1997-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 + . */ + +#ifndef _NET_IF_H +#define _NET_IF_H 1 + +#include + +/* Length of interface name. */ +#define IF_NAMESIZE 16 + +struct if_nameindex + { + unsigned int if_index; /* 1, 2, ... */ + char *if_name; /* null terminated name: "eth0", ... */ + }; + + +#ifdef __USE_MISC +# include /* for struct sockaddr */ + +/* Standard interface flags. */ +enum + { + IFF_UP = 0x1, /* Interface is up. */ +# define IFF_UP IFF_UP + IFF_BROADCAST = 0x2, /* Broadcast address valid. */ +# define IFF_BROADCAST IFF_BROADCAST + IFF_DEBUG = 0x4, /* Turn on debugging. */ +# define IFF_DEBUG IFF_DEBUG + IFF_LOOPBACK = 0x8, /* Is a loopback net. */ +# define IFF_LOOPBACK IFF_LOOPBACK + IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */ +# define IFF_POINTOPOINT IFF_POINTOPOINT + IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */ +# define IFF_NOTRAILERS IFF_NOTRAILERS + IFF_RUNNING = 0x40, /* Resources allocated. */ +# define IFF_RUNNING IFF_RUNNING + IFF_NOARP = 0x80, /* No address resolution protocol. */ +# define IFF_NOARP IFF_NOARP + IFF_PROMISC = 0x100, /* Receive all packets. */ +# define IFF_PROMISC IFF_PROMISC + + /* Not supported */ + IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */ +# define IFF_ALLMULTI IFF_ALLMULTI + + IFF_MASTER = 0x400, /* Master of a load balancer. */ +# define IFF_MASTER IFF_MASTER + IFF_SLAVE = 0x800, /* Slave of a load balancer. */ +# define IFF_SLAVE IFF_SLAVE + + IFF_MULTICAST = 0x1000, /* Supports multicast. */ +# define IFF_MULTICAST IFF_MULTICAST + + IFF_PORTSEL = 0x2000, /* Can set media type. */ +# define IFF_PORTSEL IFF_PORTSEL + IFF_AUTOMEDIA = 0x4000, /* Auto media select active. */ +# define IFF_AUTOMEDIA IFF_AUTOMEDIA + IFF_DYNAMIC = 0x8000 /* Dialup device with changing addresses. */ +# define IFF_DYNAMIC IFF_DYNAMIC + }; + +/* The ifaddr structure contains information about one address of an + interface. They are maintained by the different address families, + are allocated and attached when an address is set, and are linked + together so all addresses for an interface can be located. */ + +struct ifaddr + { + struct sockaddr ifa_addr; /* Address of interface. */ + union + { + struct sockaddr ifu_broadaddr; + struct sockaddr ifu_dstaddr; + } ifa_ifu; + struct iface *ifa_ifp; /* Back-pointer to interface. */ + struct ifaddr *ifa_next; /* Next address for interface. */ + }; + +# define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ +# define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */ + +/* Device mapping structure. I'd just gone off and designed a + beautiful scheme using only loadable modules with arguments for + driver options and along come the PCMCIA people 8) + + Ah well. The get() side of this is good for WDSETUP, and it'll be + handy for debugging things. The set side is fine for now and being + very small might be worth keeping for clean configuration. */ + +struct ifmap + { + unsigned long int mem_start; + unsigned long int mem_end; + unsigned short int base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; + /* 3 bytes spare */ + }; + +/* Interface request structure used for socket ioctl's. All interface + ioctl's must have parameter definitions which begin with ifr_name. + The remainder may be interface specific. */ + +struct ifreq + { +# define IFHWADDRLEN 6 +# define IFNAMSIZ IF_NAMESIZE + union + { + char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */ + } ifr_ifrn; + + union + { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short int ifru_flags; + int ifru_ivalue; + int ifru_mtu; + struct ifmap ifru_map; + char ifru_slave[IFNAMSIZ]; /* Just fits the size */ + char ifru_newname[IFNAMSIZ]; + char *ifru_data; + } ifr_ifru; + }; +# define ifr_name ifr_ifrn.ifrn_name /* interface name */ +# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +# define ifr_addr ifr_ifru.ifru_addr /* address */ +# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */ +# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ +# define ifr_flags ifr_ifru.ifru_flags /* flags */ +# define ifr_metric ifr_ifru.ifru_ivalue /* metric */ +# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ +# define ifr_map ifr_ifru.ifru_map /* device map */ +# define ifr_slave ifr_ifru.ifru_slave /* slave device */ +# define ifr_data ifr_ifru.ifru_data /* for use by interface */ +# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ +# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */ +# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */ +# define ifr_newname ifr_ifru.ifru_newname /* New name */ +# define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0) +# define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0) +# define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0) + + +/* Structure used in SIOCGIFCONF request. Used to retrieve interface + configuration for machine (useful for programs which must know all + networks accessible). */ + +struct ifconf + { + int ifc_len; /* Size of buffer. */ + union + { + char *ifcu_buf; + struct ifreq *ifcu_req; + } ifc_ifcu; + }; +# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */ +# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */ +# define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */ +#endif /* Misc. */ + +__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. */ +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/socket/sys/socket.h b/socket/sys/socket.h index 305e6201f9..6a68164e39 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -23,7 +23,10 @@ __BEGIN_DECLS +#include #include +#include +#include #include /* This operating system-specific header file defines the SOCK_*, PF_*, diff --git a/stdlib/sys/random.h b/stdlib/sys/random.h index b351ef5c8c..5edef78eb7 100644 --- a/stdlib/sys/random.h +++ b/stdlib/sys/random.h @@ -20,7 +20,9 @@ #define _SYS_RANDOM_H 1 #include -#include + +#include +#include /* Flags for use with getrandom. */ #define GRND_NONBLOCK 0x01 diff --git a/sysdeps/generic/net/if.h b/sysdeps/generic/net/if.h deleted file mode 100644 index 38238d7466..0000000000 --- a/sysdeps/generic/net/if.h +++ /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 - . */ - -#ifndef _NET_IF_H - -#define _NET_IF_H 1 -#include - - -__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/in_systm.h b/sysdeps/generic/netinet/in_systm.h deleted file mode 100644 index b22b26f148..0000000000 --- a/sysdeps/generic/netinet/in_systm.h +++ /dev/null @@ -1,40 +0,0 @@ -/* System specific type definitions for networking code. - Copyright (C) 1997-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 - . */ - -#ifndef _NETINET_IN_SYSTM_H -#define _NETINET_IN_SYSTM_H 1 - -#include -#include - -__BEGIN_DECLS - -/* - * Network order versions of various data types. Unfortunately, BSD - * assumes specific sizes for shorts (16 bit) and longs (32 bit) which - * don't hold in general. As a consequence, the network order versions - * may not reflect the actual size of the native data types. - */ - -typedef uint16_t n_short; /* short as received from the net */ -typedef uint32_t n_long; /* long as received from the net */ -typedef uint32_t n_time; /* ms since 00:00 GMT, byte rev */ - -__END_DECLS - -#endif /* netinet/in_systm.h */ diff --git a/sysdeps/generic/netinet/ip.h b/sysdeps/generic/netinet/ip.h deleted file mode 100644 index 8605193a44..0000000000 --- a/sysdeps/generic/netinet/ip.h +++ /dev/null @@ -1,302 +0,0 @@ -/* Copyright (C) 1991-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 - . */ - -#ifndef __NETINET_IP_H -#define __NETINET_IP_H 1 - -#include -#include - -#include - -__BEGIN_DECLS - -struct timestamp - { - uint8_t len; - uint8_t ptr; -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int flags:4; - unsigned int overflow:4; -#elif __BYTE_ORDER == __BIG_ENDIAN - unsigned int overflow:4; - unsigned int flags:4; -#else -# error "Please fix " -#endif - uint32_t data[9]; - }; - -struct iphdr - { -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int ihl:4; - unsigned int version:4; -#elif __BYTE_ORDER == __BIG_ENDIAN - unsigned int version:4; - unsigned int ihl:4; -#else -# error "Please fix " -#endif - uint8_t tos; - uint16_t tot_len; - uint16_t id; - uint16_t frag_off; - uint8_t ttl; - uint8_t protocol; - uint16_t check; - uint32_t saddr; - uint32_t daddr; - /*The options start here. */ - }; - -#ifdef __USE_MISC -/* - * 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. - * - * @(#)ip.h 8.1 (Berkeley) 6/10/93 - */ - -/* - * Definitions for internet protocol version 4. - * Per RFC 791, September 1981. - */ - -/* - * Structure of an internet header, naked of options. - */ -struct ip - { -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int ip_hl:4; /* header length */ - unsigned int ip_v:4; /* version */ -#endif -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int ip_v:4; /* version */ - unsigned int ip_hl:4; /* header length */ -#endif - uint8_t ip_tos; /* type of service */ - unsigned short ip_len; /* total length */ - unsigned short ip_id; /* identification */ - unsigned short ip_off; /* fragment offset field */ -#define IP_RF 0x8000 /* reserved fragment flag */ -#define IP_DF 0x4000 /* dont fragment flag */ -#define IP_MF 0x2000 /* more fragments flag */ -#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ - uint8_t ip_ttl; /* time to live */ - uint8_t ip_p; /* protocol */ - unsigned short ip_sum; /* checksum */ - struct in_addr ip_src, ip_dst; /* source and dest address */ - }; - -/* - * Time stamp option structure. - */ -struct ip_timestamp - { - uint8_t ipt_code; /* IPOPT_TS */ - uint8_t ipt_len; /* size of structure (variable) */ - uint8_t ipt_ptr; /* index of current entry */ -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int ipt_flg:4; /* flags, see below */ - unsigned int ipt_oflw:4; /* overflow counter */ -#endif -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int ipt_oflw:4; /* overflow counter */ - unsigned int ipt_flg:4; /* flags, see below */ -#endif - uint32_t data[9]; - }; -#endif /* __USE_MISC */ - -#define IPVERSION 4 /* IP version number */ -#define IP_MAXPACKET 65535 /* maximum packet size */ - -/* - * Definitions for Explicit Congestion Notification (ECN) - * - * Taken from RFC-3168, Section 5. - */ - -#define IPTOS_ECN_MASK 0x03 -#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK) -#define IPTOS_ECN_NOT_ECT 0x00 -#define IPTOS_ECN_ECT1 0x01 -#define IPTOS_ECN_ECT0 0x02 -#define IPTOS_ECN_CE 0x03 - -/* - * Definitions for IP differentiated services code points (DSCP) - * - * Taken from RFC-2597, Section 6 and RFC-2598, Section 2.3. - */ - -#define IPTOS_DSCP_MASK 0xfc -#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK) -#define IPTOS_DSCP_AF11 0x28 -#define IPTOS_DSCP_AF12 0x30 -#define IPTOS_DSCP_AF13 0x38 -#define IPTOS_DSCP_AF21 0x48 -#define IPTOS_DSCP_AF22 0x50 -#define IPTOS_DSCP_AF23 0x58 -#define IPTOS_DSCP_AF31 0x68 -#define IPTOS_DSCP_AF32 0x70 -#define IPTOS_DSCP_AF33 0x78 -#define IPTOS_DSCP_AF41 0x88 -#define IPTOS_DSCP_AF42 0x90 -#define IPTOS_DSCP_AF43 0x98 -#define IPTOS_DSCP_EF 0xb8 - -/* - * In RFC 2474, Section 4.2.2.1, the Class Selector Codepoints subsume - * the old ToS Precedence values. - */ - -#define IPTOS_CLASS_MASK 0xe0 -#define IPTOS_CLASS(class) ((class) & IPTOS_CLASS_MASK) -#define IPTOS_CLASS_CS0 0x00 -#define IPTOS_CLASS_CS1 0x20 -#define IPTOS_CLASS_CS2 0x40 -#define IPTOS_CLASS_CS3 0x60 -#define IPTOS_CLASS_CS4 0x80 -#define IPTOS_CLASS_CS5 0xa0 -#define IPTOS_CLASS_CS6 0xc0 -#define IPTOS_CLASS_CS7 0xe0 - -#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0 - -/* - * Definitions for IP type of service (ip_tos) [deprecated; use DSCP - * and CS definitions above instead.] - */ -#define IPTOS_TOS_MASK 0x1E -#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) -#define IPTOS_LOWDELAY 0x10 -#define IPTOS_THROUGHPUT 0x08 -#define IPTOS_RELIABILITY 0x04 -#define IPTOS_LOWCOST 0x02 -#define IPTOS_MINCOST IPTOS_LOWCOST - -/* - * Definitions for IP precedence (also in ip_tos) [also deprecated.] - */ -#define IPTOS_PREC_MASK IPTOS_CLASS_MASK -#define IPTOS_PREC(tos) IPTOS_CLASS(tos) -#define IPTOS_PREC_NETCONTROL IPTOS_CLASS_CS7 -#define IPTOS_PREC_INTERNETCONTROL IPTOS_CLASS_CS6 -#define IPTOS_PREC_CRITIC_ECP IPTOS_CLASS_CS5 -#define IPTOS_PREC_FLASHOVERRIDE IPTOS_CLASS_CS4 -#define IPTOS_PREC_FLASH IPTOS_CLASS_CS3 -#define IPTOS_PREC_IMMEDIATE IPTOS_CLASS_CS2 -#define IPTOS_PREC_PRIORITY IPTOS_CLASS_CS1 -#define IPTOS_PREC_ROUTINE IPTOS_CLASS_CS0 - -/* - * Definitions for options. - */ -#define IPOPT_COPY 0x80 -#define IPOPT_CLASS_MASK 0x60 -#define IPOPT_NUMBER_MASK 0x1f - -#define IPOPT_COPIED(o) ((o) & IPOPT_COPY) -#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK) -#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK) - -#define IPOPT_CONTROL 0x00 -#define IPOPT_RESERVED1 0x20 -#define IPOPT_DEBMEAS 0x40 -#define IPOPT_MEASUREMENT IPOPT_DEBMEAS -#define IPOPT_RESERVED2 0x60 - -#define IPOPT_EOL 0 /* end of option list */ -#define IPOPT_END IPOPT_EOL -#define IPOPT_NOP 1 /* no operation */ -#define IPOPT_NOOP IPOPT_NOP - -#define IPOPT_RR 7 /* record packet route */ -#define IPOPT_TS 68 /* timestamp */ -#define IPOPT_TIMESTAMP IPOPT_TS -#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ -#define IPOPT_SEC IPOPT_SECURITY -#define IPOPT_LSRR 131 /* loose source route */ -#define IPOPT_SATID 136 /* satnet id */ -#define IPOPT_SID IPOPT_SATID -#define IPOPT_SSRR 137 /* strict source route */ -#define IPOPT_RA 148 /* router alert */ - -/* - * Offsets to fields in options other than EOL and NOP. - */ -#define IPOPT_OPTVAL 0 /* option ID */ -#define IPOPT_OLEN 1 /* option length */ -#define IPOPT_OFFSET 2 /* offset within option */ -#define IPOPT_MINOFF 4 /* min value of above */ - -#define MAX_IPOPTLEN 40 - -/* flag bits for ipt_flg */ -#define IPOPT_TS_TSONLY 0 /* timestamps only */ -#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ -#define IPOPT_TS_PRESPEC 3 /* specified modules only */ - -/* bits for security (not byte swapped) */ -#define IPOPT_SECUR_UNCLASS 0x0000 -#define IPOPT_SECUR_CONFID 0xf135 -#define IPOPT_SECUR_EFTO 0x789a -#define IPOPT_SECUR_MMMM 0xbc4d -#define IPOPT_SECUR_RESTR 0xaf13 -#define IPOPT_SECUR_SECRET 0xd788 -#define IPOPT_SECUR_TOPSECRET 0x6bc5 - -/* - * Internet implementation parameters. - */ -#define MAXTTL 255 /* maximum time to live (seconds) */ -#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ -#define IPFRAGTTL 60 /* time to live for frags, slowhz */ -#define IPTTLDEC 1 /* subtracted when forwarding */ - -#define IP_MSS 576 /* default maximum segment size */ - -__END_DECLS - -#endif /* netinet/ip.h */ diff --git a/sysdeps/generic/netinet/tcp.h b/sysdeps/generic/netinet/tcp.h deleted file mode 100644 index 3b59e949d8..0000000000 --- a/sysdeps/generic/netinet/tcp.h +++ /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 - -__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 */ diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile index 97fcb6fb90..37b47c8223 100644 --- a/sysdeps/gnu/Makefile +++ b/sysdeps/gnu/Makefile @@ -58,24 +58,12 @@ $(foreach o,$(object-suffixes) $(object-suffixes:=.d),\ $(objpfx)errlist$o): $(objpfx)errlist-compat.h endif -ifeq ($(subdir),login) -sysdep_routines += setutxent getutxent endutxent getutxid getutxline \ - pututxline utmpxname updwtmpx getutmpx getutmp - -sysdep_headers += utmpx.h bits/utmpx.h -endif - ifeq ($(subdir),inet) sysdep_headers += netinet/udp.h netinet/ip_icmp.h endif -ifeq ($(subdir),misc) -sysdep_headers += sys/mtio.h -endif - - ifeq ($(subdir),csu) routines += unwind-resume shared-only-routines += unwind-resume diff --git a/sysdeps/gnu/bits/sem.h b/sysdeps/gnu/bits/sem.h index c2914d3154..02e24915b7 100644 --- a/sysdeps/gnu/bits/sem.h +++ b/sysdeps/gnu/bits/sem.h @@ -15,11 +15,14 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_SEM_H +#define _BITS_SEM_H 1 + #ifndef _SYS_SEM_H # error "Never include directly; use instead." #endif -#include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ @@ -85,3 +88,5 @@ struct seminfo }; #endif /* __USE_MISC */ + +#endif /* bits/sem.h */ diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h deleted file mode 100644 index dfd55bfcc3..0000000000 --- a/sysdeps/gnu/bits/utmpx.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Structures and definitions for the user accounting database. GNU version. - Copyright (C) 1997-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 - . */ - -#ifndef _UTMPX_H -# error "Never include directly; use instead." -#endif - -#include -#include -#include - - -#ifdef __USE_GNU -# include -# define _PATH_UTMPX _PATH_UTMP -# define _PATH_WTMPX _PATH_WTMP -#endif - - -#define __UT_LINESIZE 32 -#define __UT_NAMESIZE 32 -#define __UT_HOSTSIZE 256 - - -/* The structure describing the status of a terminated process. This - type is used in `struct utmpx' below. */ -struct __exit_status - { -#ifdef __USE_GNU - short int e_termination; /* Process termination status. */ - short int e_exit; /* Process exit status. */ -#else - short int __e_termination; /* Process termination status. */ - short int __e_exit; /* Process exit status. */ -#endif - }; - - -/* The structure describing an entry in the user accounting database. */ -struct utmpx -{ - short int ut_type; /* Type of login. */ - __pid_t ut_pid; /* Process ID of login process. */ - char ut_line[__UT_LINESIZE] - __attribute_nonstring__; /* Devicename. */ - char ut_id[4] - __attribute_nonstring__; /* Inittab ID. */ - char ut_user[__UT_NAMESIZE] - __attribute_nonstring__; /* Username. */ - char ut_host[__UT_HOSTSIZE] - __attribute_nonstring__; /* Hostname for remote login. */ - 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_TIME64_COMPAT32 - __int32_t ut_session; /* Session ID, used for windowing. */ - struct - { - __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. */ -#endif - __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ -}; - - -/* Values for the `ut_type' field of a `struct utmpx'. */ -#define EMPTY 0 /* No valid user accounting information. */ - -#ifdef __USE_GNU -# define RUN_LVL 1 /* The system's runlevel. */ -#endif -#define BOOT_TIME 2 /* Time of system boot. */ -#define NEW_TIME 3 /* Time after system clock changed. */ -#define OLD_TIME 4 /* Time when system clock changed. */ - -#define INIT_PROCESS 5 /* Process spawned by the init process. */ -#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ -#define USER_PROCESS 7 /* Normal process. */ -#define DEAD_PROCESS 8 /* Terminated process. */ - -#ifdef __USE_GNU -# define ACCOUNTING 9 /* System accounting. */ -#endif diff --git a/sysdeps/gnu/net/if.h b/sysdeps/gnu/net/if.h deleted file mode 100644 index 8ab14d0d14..0000000000 --- a/sysdeps/gnu/net/if.h +++ /dev/null @@ -1,204 +0,0 @@ -/* net/if.h -- declarations for inquiring about network interfaces - Copyright (C) 1997-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 - . */ - -#ifndef _NET_IF_H -#define _NET_IF_H 1 - -#include - -#ifdef __USE_MISC -# include -# include -#endif - - -/* Length of interface name. */ -#define IF_NAMESIZE 16 - -struct if_nameindex - { - unsigned int if_index; /* 1, 2, ... */ - char *if_name; /* null terminated name: "eth0", ... */ - }; - - -#ifdef __USE_MISC -/* Standard interface flags. */ -enum - { - IFF_UP = 0x1, /* Interface is up. */ -# define IFF_UP IFF_UP - IFF_BROADCAST = 0x2, /* Broadcast address valid. */ -# define IFF_BROADCAST IFF_BROADCAST - IFF_DEBUG = 0x4, /* Turn on debugging. */ -# define IFF_DEBUG IFF_DEBUG - IFF_LOOPBACK = 0x8, /* Is a loopback net. */ -# define IFF_LOOPBACK IFF_LOOPBACK - IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */ -# define IFF_POINTOPOINT IFF_POINTOPOINT - IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */ -# define IFF_NOTRAILERS IFF_NOTRAILERS - IFF_RUNNING = 0x40, /* Resources allocated. */ -# define IFF_RUNNING IFF_RUNNING - IFF_NOARP = 0x80, /* No address resolution protocol. */ -# define IFF_NOARP IFF_NOARP - IFF_PROMISC = 0x100, /* Receive all packets. */ -# define IFF_PROMISC IFF_PROMISC - - /* Not supported */ - IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */ -# define IFF_ALLMULTI IFF_ALLMULTI - - IFF_MASTER = 0x400, /* Master of a load balancer. */ -# define IFF_MASTER IFF_MASTER - IFF_SLAVE = 0x800, /* Slave of a load balancer. */ -# define IFF_SLAVE IFF_SLAVE - - IFF_MULTICAST = 0x1000, /* Supports multicast. */ -# define IFF_MULTICAST IFF_MULTICAST - - IFF_PORTSEL = 0x2000, /* Can set media type. */ -# define IFF_PORTSEL IFF_PORTSEL - IFF_AUTOMEDIA = 0x4000, /* Auto media select active. */ -# define IFF_AUTOMEDIA IFF_AUTOMEDIA - IFF_DYNAMIC = 0x8000 /* Dialup device with changing addresses. */ -# define IFF_DYNAMIC IFF_DYNAMIC - }; - -/* The ifaddr structure contains information about one address of an - interface. They are maintained by the different address families, - are allocated and attached when an address is set, and are linked - together so all addresses for an interface can be located. */ - -struct ifaddr - { - struct sockaddr ifa_addr; /* Address of interface. */ - union - { - struct sockaddr ifu_broadaddr; - struct sockaddr ifu_dstaddr; - } ifa_ifu; - struct iface *ifa_ifp; /* Back-pointer to interface. */ - struct ifaddr *ifa_next; /* Next address for interface. */ - }; - -# define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ -# define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */ - -/* Device mapping structure. I'd just gone off and designed a - beautiful scheme using only loadable modules with arguments for - driver options and along come the PCMCIA people 8) - - Ah well. The get() side of this is good for WDSETUP, and it'll be - handy for debugging things. The set side is fine for now and being - very small might be worth keeping for clean configuration. */ - -struct ifmap - { - unsigned long int mem_start; - unsigned long int mem_end; - unsigned short int base_addr; - unsigned char irq; - unsigned char dma; - unsigned char port; - /* 3 bytes spare */ - }; - -/* Interface request structure used for socket ioctl's. All interface - ioctl's must have parameter definitions which begin with ifr_name. - The remainder may be interface specific. */ - -struct ifreq - { -# define IFHWADDRLEN 6 -# define IFNAMSIZ IF_NAMESIZE - union - { - char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */ - } ifr_ifrn; - - union - { - struct sockaddr ifru_addr; - struct sockaddr ifru_dstaddr; - struct sockaddr ifru_broadaddr; - struct sockaddr ifru_netmask; - struct sockaddr ifru_hwaddr; - short int ifru_flags; - int ifru_ivalue; - int ifru_mtu; - struct ifmap ifru_map; - char ifru_slave[IFNAMSIZ]; /* Just fits the size */ - char ifru_newname[IFNAMSIZ]; - char *ifru_data; - } ifr_ifru; - }; -# define ifr_name ifr_ifrn.ifrn_name /* interface name */ -# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -# define ifr_addr ifr_ifru.ifru_addr /* address */ -# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */ -# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ -# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ -# define ifr_flags ifr_ifru.ifru_flags /* flags */ -# define ifr_metric ifr_ifru.ifru_ivalue /* metric */ -# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ -# define ifr_map ifr_ifru.ifru_map /* device map */ -# define ifr_slave ifr_ifru.ifru_slave /* slave device */ -# define ifr_data ifr_ifru.ifru_data /* for use by interface */ -# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ -# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */ -# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */ -# define ifr_newname ifr_ifru.ifru_newname /* New name */ -# define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0) -# define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0) -# define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0) - - -/* Structure used in SIOCGIFCONF request. Used to retrieve interface - configuration for machine (useful for programs which must know all - networks accessible). */ - -struct ifconf - { - int ifc_len; /* Size of buffer. */ - union - { - char *ifcu_buf; - struct ifreq *ifcu_req; - } ifc_ifcu; - }; -# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */ -# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */ -# define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */ -#endif /* Misc. */ - -__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. */ -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/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h deleted file mode 100644 index 41ca11b5f5..0000000000 --- a/sysdeps/gnu/netinet/tcp.h +++ /dev/null @@ -1,349 +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 - -/* - * User-settable options (used with setsockopt). - */ -#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ -#define TCP_MAXSEG 2 /* Set maximum segment size */ -#define TCP_CORK 3 /* Control sending of partial frames */ -#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ -#define TCP_KEEPINTVL 5 /* Interval between keepalives */ -#define TCP_KEEPCNT 6 /* Number of keepalives before death */ -#define TCP_SYNCNT 7 /* Number of SYN retransmits */ -#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ -#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ -#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ -#define TCP_INFO 11 /* Information about this connection. */ -#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ -#define TCP_CONGESTION 13 /* Congestion control algorithm. */ -#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ -#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ -#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ -#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ -#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ -#define TCP_REPAIR 19 /* TCP sock is under repair right now */ -#define TCP_REPAIR_QUEUE 20 /* Set TCP queue to repair */ -#define TCP_QUEUE_SEQ 21 /* Set sequence number of repaired queue. */ -#define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */ -#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ -#define TCP_TIMESTAMP 24 /* TCP time stamp */ -#define TCP_NOTSENT_LOWAT 25 /* Limit number of unsent bytes in - write queue. */ -#define TCP_CC_INFO 26 /* Get Congestion Control - (optional) info. */ -#define TCP_SAVE_SYN 27 /* Record SYN headers for new - connections. */ -#define TCP_SAVED_SYN 28 /* Get SYN headers recorded for - connection. */ -#define TCP_REPAIR_WINDOW 29 /* Get/set window parameters. */ -#define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect. */ -#define TCP_ULP 31 /* Attach a ULP to a TCP connection. */ -#define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions. */ -#define TCP_FASTOPEN_KEY 33 /* Set the key for Fast Open (cookie). */ -#define TCP_FASTOPEN_NO_COOKIE 34 /* Enable TFO without a TFO cookie. */ -#define TCP_ZEROCOPY_RECEIVE 35 -#define TCP_INQ 36 /* Notify bytes available to read - as a cmsg on read. */ -#define TCP_CM_INQ TCP_INQ -#define TCP_TX_DELAY 37 /* Delay outgoing packets by XX usec. */ - -#define TCP_REPAIR_ON 1 -#define TCP_REPAIR_OFF 0 -#define TCP_REPAIR_OFF_NO_WP -1 - -#ifdef __USE_MISC -# include -# include -# include - -typedef uint32_t tcp_seq; -/* - * TCP header. - * Per RFC 793, September, 1981. - */ -struct tcphdr - { - __extension__ union - { - struct - { - uint16_t th_sport; /* source port */ - uint16_t th_dport; /* destination port */ - tcp_seq th_seq; /* sequence number */ - tcp_seq th_ack; /* acknowledgement number */ -# if __BYTE_ORDER == __LITTLE_ENDIAN - uint8_t th_x2:4; /* (unused) */ - uint8_t th_off:4; /* data offset */ -# endif -# if __BYTE_ORDER == __BIG_ENDIAN - uint8_t th_off:4; /* data offset */ - uint8_t th_x2:4; /* (unused) */ -# endif - uint8_t 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 - uint16_t th_win; /* window */ - uint16_t th_sum; /* checksum */ - uint16_t th_urp; /* urgent pointer */ - }; - struct - { - uint16_t source; - uint16_t dest; - uint32_t seq; - uint32_t ack_seq; -# if __BYTE_ORDER == __LITTLE_ENDIAN - uint16_t res1:4; - uint16_t doff:4; - uint16_t fin:1; - uint16_t syn:1; - uint16_t rst:1; - uint16_t psh:1; - uint16_t ack:1; - uint16_t urg:1; - uint16_t res2:2; -# elif __BYTE_ORDER == __BIG_ENDIAN - uint16_t doff:4; - uint16_t res1:4; - uint16_t res2:2; - uint16_t urg:1; - uint16_t ack:1; - uint16_t psh:1; - uint16_t rst:1; - uint16_t syn:1; - uint16_t fin:1; -# else -# error "Adjust your defines" -# endif - uint16_t window; - uint16_t check; - uint16_t urg_ptr; - }; - }; -}; - -enum -{ - TCP_ESTABLISHED = 1, - TCP_SYN_SENT, - TCP_SYN_RECV, - TCP_FIN_WAIT1, - TCP_FIN_WAIT2, - TCP_TIME_WAIT, - TCP_CLOSE, - TCP_CLOSE_WAIT, - TCP_LAST_ACK, - TCP_LISTEN, - TCP_CLOSING /* now a valid state */ -}; - -# 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 */ - -# define SOL_TCP 6 /* TCP level */ - - -# define TCPI_OPT_TIMESTAMPS 1 -# define TCPI_OPT_SACK 2 -# define TCPI_OPT_WSCALE 4 -# define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ -# define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ -# define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ - -/* Values for tcpi_state. */ -enum tcp_ca_state -{ - TCP_CA_Open = 0, - TCP_CA_Disorder = 1, - TCP_CA_CWR = 2, - TCP_CA_Recovery = 3, - TCP_CA_Loss = 4 -}; - -struct tcp_info -{ - uint8_t tcpi_state; - uint8_t tcpi_ca_state; - uint8_t tcpi_retransmits; - uint8_t tcpi_probes; - uint8_t tcpi_backoff; - uint8_t tcpi_options; - uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; - - uint32_t tcpi_rto; - uint32_t tcpi_ato; - uint32_t tcpi_snd_mss; - uint32_t tcpi_rcv_mss; - - uint32_t tcpi_unacked; - uint32_t tcpi_sacked; - uint32_t tcpi_lost; - uint32_t tcpi_retrans; - uint32_t tcpi_fackets; - - /* Times. */ - uint32_t tcpi_last_data_sent; - uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ - uint32_t tcpi_last_data_recv; - uint32_t tcpi_last_ack_recv; - - /* Metrics. */ - uint32_t tcpi_pmtu; - uint32_t tcpi_rcv_ssthresh; - uint32_t tcpi_rtt; - uint32_t tcpi_rttvar; - uint32_t tcpi_snd_ssthresh; - uint32_t tcpi_snd_cwnd; - uint32_t tcpi_advmss; - uint32_t tcpi_reordering; - - uint32_t tcpi_rcv_rtt; - uint32_t tcpi_rcv_space; - - uint32_t tcpi_total_retrans; -}; - - -/* For TCP_MD5SIG socket option. */ -#define TCP_MD5SIG_MAXKEYLEN 80 - -/* tcp_md5sig extension flags for TCP_MD5SIG_EXT. */ -#define TCP_MD5SIG_FLAG_PREFIX 1 /* Address prefix length. */ - -struct tcp_md5sig -{ - struct sockaddr_storage tcpm_addr; /* Address associated. */ - uint8_t tcpm_flags; /* Extension flags. */ - uint8_t tcpm_prefixlen; /* Address prefix. */ - uint16_t tcpm_keylen; /* Key length. */ - uint32_t __tcpm_pad; /* Zero. */ - uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */ -}; - -/* For socket repair options. */ -struct tcp_repair_opt -{ - uint32_t opt_code; - uint32_t opt_val; -}; - -/* Queue to repair, for TCP_REPAIR_QUEUE. */ -enum -{ - TCP_NO_QUEUE, - TCP_RECV_QUEUE, - TCP_SEND_QUEUE, - TCP_QUEUES_NR, -}; - -/* For cookie transactions socket options. */ -#define TCP_COOKIE_MIN 8 /* 64-bits */ -#define TCP_COOKIE_MAX 16 /* 128-bits */ -#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX) - -/* Flags for both getsockopt and setsockopt */ -#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */ -#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies, - * supercedes everything. */ - -/* Flags for getsockopt */ -#define TCP_S_DATA_IN (1 << 2) /* Was data received? */ -#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */ - -#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */ -#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */ - -struct tcp_cookie_transactions -{ - uint16_t tcpct_flags; - uint8_t __tcpct_pad1; - uint8_t tcpct_cookie_desired; - uint16_t tcpct_s_data_desired; - uint16_t tcpct_used; - uint8_t tcpct_value[TCP_MSS_DEFAULT]; -}; - -/* For use with TCP_REPAIR_WINDOW. */ -struct tcp_repair_window -{ - uint32_t snd_wl1; - uint32_t snd_wnd; - uint32_t max_window; - uint32_t rcv_wnd; - uint32_t rcv_wup; -}; - -/* For use with TCP_ZEROCOPY_RECEIVE. */ -struct tcp_zerocopy_receive -{ - uint64_t address; /* In: address of mapping. */ - uint32_t length; /* In/out: number of bytes to map/mapped. */ - uint32_t recv_skip_hint; /* Out: amount of bytes to skip. */ -}; - -#endif /* Misc. */ - -#endif /* netinet/tcp.h */ diff --git a/sysdeps/gnu/sys/mtio.h b/sysdeps/gnu/sys/mtio.h deleted file mode 100644 index 17a9b210d9..0000000000 --- a/sysdeps/gnu/sys/mtio.h +++ /dev/null @@ -1,276 +0,0 @@ -/* Structures and definitions for magnetic tape I/O control commands. - Copyright (C) 1996-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 - . */ - -/* Written by H. Bergman . */ - -#ifndef _SYS_MTIO_H -#define _SYS_MTIO_H 1 - -/* Get necessary definitions from system and kernel headers. */ -#include -#include - - -/* Structure for MTIOCTOP - magnetic tape operation command. */ -struct mtop - { - short int mt_op; /* Operations defined below. */ - int mt_count; /* How many of them. */ - }; -#define _IOT_mtop /* Hurd ioctl type field. */ \ - _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0) - -/* Magnetic Tape operations [Not all operations supported by all drivers]. */ -#define MTRESET 0 /* +reset drive in case of problems. */ -#define MTFSF 1 /* Forward space over FileMark, - * position at first record of next file. */ -#define MTBSF 2 /* Backward space FileMark (position before FM). */ -#define MTFSR 3 /* Forward space record. */ -#define MTBSR 4 /* Backward space record. */ -#define MTWEOF 5 /* Write an end-of-file record (mark). */ -#define MTREW 6 /* Rewind. */ -#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */ -#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */ -#define MTRETEN 9 /* Retension tape. */ -#define MTBSFM 10 /* +backward space FileMark, position at FM. */ -#define MTFSFM 11 /* +forward space FileMark, position at FM. */ -#define MTEOM 12 /* Goto end of recorded media (for appending files). - MTEOM positions after the last FM, ready for - appending another file. */ -#define MTERASE 13 /* Erase tape -- be careful! */ - -#define MTRAS1 14 /* Run self test 1 (nondestructive). */ -#define MTRAS2 15 /* Run self test 2 (destructive). */ -#define MTRAS3 16 /* Reserved for self test 3. */ - -#define MTSETBLK 20 /* Set block length (SCSI). */ -#define MTSETDENSITY 21 /* Set tape density (SCSI). */ -#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */ -#define MTTELL 23 /* Tell block (Tandberg, etc.). */ -#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2. - Ordinary buffered operation with code 1. */ -#define MTFSS 25 /* Space forward over setmarks. */ -#define MTBSS 26 /* Space backward over setmarks. */ -#define MTWSM 27 /* Write setmarks. */ - -#define MTLOCK 28 /* Lock the drive door. */ -#define MTUNLOCK 29 /* Unlock the drive door. */ -#define MTLOAD 30 /* Execute the SCSI load command. */ -#define MTUNLOAD 31 /* Execute the SCSI unload command. */ -#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */ -#define MTSETPART 33 /* Change the active tape partition. */ -#define MTMKPART 34 /* Format the tape with one or two partitions. */ - -/* structure for MTIOCGET - mag tape get status command */ - -struct mtget - { - long int mt_type; /* Type of magtape device. */ - long int mt_resid; /* Residual count: (not sure) - number of bytes ignored, or - number of files not skipped, or - number of records not skipped. */ - /* The following registers are device dependent. */ - long int mt_dsreg; /* Status register. */ - long int mt_gstat; /* Generic (device independent) status. */ - long int mt_erreg; /* Error register. */ - /* The next two fields are not always used. */ - int mt_fileno; /* Number of current file on tape. */ - int mt_blkno; /* Current block number. */ - }; -#define _IOT_mtget /* Hurd ioctl type field. */ \ - _IOT (_IOTS (long), 7, 0, 0, 0, 0) - - -/* Constants for mt_type. Not all of these are supported, and - these are not all of the ones that are supported. */ -#define MT_ISUNKNOWN 0x01 -#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */ -#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */ -#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */ -#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */ -#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */ -#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */ -#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */ -#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */ -#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */ -#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */ -#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */ -#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, - Teac DC-1 card (Wangtek type). */ -#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */ -#define MT_ISDDS1 0x51 /* DDS device without partitions. */ -#define MT_ISDDS2 0x52 /* DDS device with partitions. */ -#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */ -#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */ - -/* QIC-40/80/3010/3020 ftape supported drives. - 20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */ -#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */ -#define MT_ISFTAPE_FLAG 0x800000 - -struct mt_tape_info - { - long int t_type; /* Device type id (mt_type). */ - char *t_name; /* Descriptive name. */ - }; - -#define MT_TAPE_INFO \ - { \ - {MT_ISUNKNOWN, "Unknown type of tape device"}, \ - {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \ - {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \ - {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \ - {MT_ISCMSJ500, "CMS Jumbo 500"}, \ - {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \ - {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \ - {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \ - {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \ - {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \ - {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \ - {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \ - {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \ - {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \ - {MT_ISSCSI1, "Generic SCSI-1 tape"}, \ - {MT_ISSCSI2, "Generic SCSI-2 tape"}, \ - {0, NULL} \ - } - - -/* Structure for MTIOCPOS - mag tape get position command. */ - -struct mtpos - { - long int mt_blkno; /* Current block number. */ - }; -#define _IOT_mtpos /* Hurd ioctl type field. */ \ - _IOT_SIMPLE (long) - - -/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended - as an interim solution for QIC-02 until DDI is fully implemented. */ -struct mtconfiginfo - { - long int mt_type; /* Drive type. */ - long int ifc_type; /* Interface card type. */ - unsigned short int irqnr; /* IRQ number to use. */ - unsigned short int dmanr; /* DMA channel to use. */ - unsigned short int port; /* IO port base address. */ - - unsigned long int debug; /* Debugging flags. */ - - unsigned have_dens:1; - unsigned have_bsf:1; - unsigned have_fsr:1; - unsigned have_bsr:1; - unsigned have_eod:1; - unsigned have_seek:1; - unsigned have_tell:1; - unsigned have_ras1:1; - unsigned have_ras2:1; - unsigned have_ras3:1; - unsigned have_qfa:1; - - unsigned pad1:5; - char reserved[10]; - }; -#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \ - _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */ - - -/* Magnetic tape I/O control commands. */ -#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */ -#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */ -#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/ - -/* The next two are used by the QIC-02 driver for runtime reconfiguration. - See tpqic02.h for struct mtconfiginfo. */ -#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/ -#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/ - -/* Generic Mag Tape (device independent) status macros for examining - mt_gstat -- HP-UX compatible. - There is room for more generic status bits here, but I don't - know which of them are reserved. At least three or so should - be added to make this really useful. */ -#define GMT_EOF(x) ((x) & 0x80000000) -#define GMT_BOT(x) ((x) & 0x40000000) -#define GMT_EOT(x) ((x) & 0x20000000) -#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */ -#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */ -#define GMT_WR_PROT(x) ((x) & 0x04000000) -/* #define GMT_ ? ((x) & 0x02000000) */ -#define GMT_ONLINE(x) ((x) & 0x01000000) -#define GMT_D_6250(x) ((x) & 0x00800000) -#define GMT_D_1600(x) ((x) & 0x00400000) -#define GMT_D_800(x) ((x) & 0x00200000) -/* #define GMT_ ? ((x) & 0x00100000) */ -/* #define GMT_ ? ((x) & 0x00080000) */ -#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */ -/* #define GMT_ ? ((x) & 0x00020000) */ -#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/ -/* 16 generic status bits unused. */ - - -/* SCSI-tape specific definitions. Bitfield shifts in the status */ -#define MT_ST_BLKSIZE_SHIFT 0 -#define MT_ST_BLKSIZE_MASK 0xffffff -#define MT_ST_DENSITY_SHIFT 24 -#define MT_ST_DENSITY_MASK 0xff000000 - -#define MT_ST_SOFTERR_SHIFT 0 -#define MT_ST_SOFTERR_MASK 0xffff - -/* Bitfields for the MTSETDRVBUFFER ioctl. */ -#define MT_ST_OPTIONS 0xf0000000 -#define MT_ST_BOOLEANS 0x10000000 -#define MT_ST_SETBOOLEANS 0x30000000 -#define MT_ST_CLEARBOOLEANS 0x40000000 -#define MT_ST_WRITE_THRESHOLD 0x20000000 -#define MT_ST_DEF_BLKSIZE 0x50000000 -#define MT_ST_DEF_OPTIONS 0x60000000 - -#define MT_ST_BUFFER_WRITES 0x1 -#define MT_ST_ASYNC_WRITES 0x2 -#define MT_ST_READ_AHEAD 0x4 -#define MT_ST_DEBUGGING 0x8 -#define MT_ST_TWO_FM 0x10 -#define MT_ST_FAST_MTEOM 0x20 -#define MT_ST_AUTO_LOCK 0x40 -#define MT_ST_DEF_WRITES 0x80 -#define MT_ST_CAN_BSR 0x100 -#define MT_ST_NO_BLKLIMS 0x200 -#define MT_ST_CAN_PARTITIONS 0x400 -#define MT_ST_SCSI2LOGICAL 0x800 - -/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */ -#define MT_ST_CLEAR_DEFAULT 0xfffff -#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000) -#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000) -#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000) - -/* The offset for the arguments for the special HP changer load command. */ -#define MT_ST_HPLOADER_OFFSET 10000 - - -/* Specify default tape device. */ -#ifndef DEFTAPE -# define DEFTAPE "/dev/tape" -#endif - -#endif /* mtio.h */ diff --git a/sysdeps/gnu/utmpx.h b/sysdeps/gnu/utmpx.h deleted file mode 100644 index b1a82a46cf..0000000000 --- a/sysdeps/gnu/utmpx.h +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright (C) 1997-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 - . */ - -#ifndef _UTMPX_H -#define _UTMPX_H 1 - -#include -#include - -/* Required according to Unix98. */ -#include - -/* Get system dependent values and data structures. */ -#include - -#ifdef __USE_GNU -/* Compatibility names for the strings of the canonical file names. */ -# define UTMPX_FILE _PATH_UTMPX -# define UTMPX_FILENAME _PATH_UTMPX -# define WTMPX_FILE _PATH_WTMPX -# define WTMPX_FILENAME _PATH_WTMPX -#endif - -/* For the getutmp{,x} functions we need the `struct utmp'. */ -#ifdef __USE_GNU -struct utmp; -#endif - - -__BEGIN_DECLS - -/* Open user accounting database. - - This function is a possible cancellation point and therefore not - marked with __THROW. */ -extern void setutxent (void); - -/* Close user accounting database. - - This function is a possible cancellation point and therefore not - marked with __THROW. */ -extern void endutxent (void); - -/* Get the next entry from the user accounting database. - - This function is a possible cancellation point and therefore not - marked with __THROW. */ -extern struct utmpx *getutxent (void); - -/* Get the user accounting database entry corresponding to ID. - - This function is a possible cancellation point and therefore not - marked with __THROW. */ -extern struct utmpx *getutxid (const struct utmpx *__id); - -/* Get the user accounting database entry corresponding to LINE. - - This function is a possible cancellation point and therefore not - marked with __THROW. */ -extern struct utmpx *getutxline (const struct utmpx *__line); - -/* Write the entry UTMPX into the user accounting database. - - This function is a possible cancellation point and therefore not - marked with __THROW. */ -extern struct utmpx *pututxline (const struct utmpx *__utmpx); - - -#ifdef __USE_GNU -/* Change name of the utmpx file to be examined. - - This function is not part of POSIX and therefore no official - cancellation point. But due to similarity with an POSIX interface - or due to the implementation it is a cancellation point and - therefore not marked with __THROW. */ -extern int utmpxname (const char *__file); - -/* Append entry UTMP to the wtmpx-like file WTMPX_FILE. - - This function is not part of POSIX and therefore no official - cancellation point. But due to similarity with an POSIX interface - or due to the implementation it is a cancellation point and - therefore not marked with __THROW. */ -extern void updwtmpx (const char *__wtmpx_file, - const struct utmpx *__utmpx); - - -/* Copy the information in UTMPX to UTMP. - - This function is not part of POSIX and therefore no official - cancellation point. But due to similarity with an POSIX interface - or due to the implementation it is a cancellation point and - therefore not marked with __THROW. */ -extern void getutmp (const struct utmpx *__utmpx, - struct utmp *__utmp); - -/* Copy the information in UTMP to UTMPX. - - This function is not part of POSIX and therefore no official - cancellation point. But due to similarity with an POSIX interface - or due to the implementation it is a cancellation point and - therefore not marked with __THROW. */ -extern void getutmpx (const struct utmp *__utmp, struct utmpx *__utmpx); -#endif - -__END_DECLS - -#endif /* utmpx.h */ diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h index 6678033857..ad6b1f91b4 100644 --- a/sysdeps/mach/hurd/bits/fcntl.h +++ b/sysdeps/mach/hurd/bits/fcntl.h @@ -16,11 +16,14 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_FCNTL_H +#define _BITS_FCNTL_H 1 + #ifndef _FCNTL_H # error "Never use directly; include instead." #endif -#include +#include /* File access modes. These are understood by io servers; they can be passed in `dir_lookup', and are returned by `io_get_openmodes'. @@ -180,13 +183,9 @@ # define F_DUPFD_CLOEXEC 1030 /* Duplicate, set FD_CLOEXEC on new one. */ #endif - /* File descriptor flags used with F_GETFD and F_SETFD. */ #define FD_CLOEXEC 1 /* Close on exec. */ - -#include - /* The structure describing an advisory lock. This is the type of the third argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ struct flock @@ -228,3 +227,5 @@ struct flock64 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +#endif /* bits/fcntl.h */ diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h index f7c6f56298..828a8efbf2 100644 --- a/sysdeps/mach/hurd/bits/socket.h +++ b/sysdeps/mach/hurd/bits/socket.h @@ -25,7 +25,7 @@ #endif -#include +#include #include #include #include diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile index aa23a4b209..50ce5634b2 100644 --- a/sysdeps/mach/hurd/i386/Makefile +++ b/sysdeps/mach/hurd/i386/Makefile @@ -20,69 +20,34 @@ ifeq ($(subdir),conform) conformtest-xfail-conds += i386-gnu # For bug 23088 -test-xfail-POSIX/fcntl.h/conform = yes test-xfail-POSIX/signal.h/conform = yes -test-xfail-POSIX/semaphore.h/conform = yes test-xfail-POSIX/regex.h/conform = yes test-xfail-POSIX/aio.h/conform = yes test-xfail-POSIX/mqueue.h/conform = yes test-xfail-POSIX/sys/types.h/conform = yes -test-xfail-UNIX98/fcntl.h/conform = yes -test-xfail-UNIX98/netdb.h/conform = yes test-xfail-UNIX98/signal.h/conform = yes -test-xfail-UNIX98/semaphore.h/conform = yes test-xfail-UNIX98/regex.h/conform = yes test-xfail-UNIX98/aio.h/conform = yes -test-xfail-UNIX98/ftw.h/conform = yes test-xfail-UNIX98/mqueue.h/conform = yes -test-xfail-UNIX98/netinet/in.h/conform = yes -test-xfail-UNIX98/sys/sem.h/conform = yes -test-xfail-UNIX98/sys/uio.h/conform = yes -test-xfail-UNIX98/sys/socket.h/conform = yes test-xfail-UNIX98/sys/types.h/conform = yes test-xfail-UNIX98/stdlib.h/conform = yes -test-xfail-UNIX98/arpa/inet.h/conform = yes -test-xfail-POSIX2008/fcntl.h/conform = yes -test-xfail-POSIX2008/netdb.h/conform = yes test-xfail-POSIX2008/signal.h/conform = yes -test-xfail-POSIX2008/semaphore.h/conform = yes test-xfail-POSIX2008/regex.h/conform = yes test-xfail-POSIX2008/aio.h/conform = yes test-xfail-POSIX2008/mqueue.h/conform = yes -test-xfail-POSIX2008/netinet/in.h/conform = yes -test-xfail-POSIX2008/sys/socket.h/conform = yes test-xfail-POSIX2008/sys/types.h/conform = yes -test-xfail-POSIX2008/arpa/inet.h/conform = yes -test-xfail-XOPEN2K/fcntl.h/conform = yes -test-xfail-XOPEN2K/netdb.h/conform = yes test-xfail-XOPEN2K/signal.h/conform = yes -test-xfail-XOPEN2K/semaphore.h/conform = yes test-xfail-XOPEN2K/regex.h/conform = yes test-xfail-XOPEN2K/aio.h/conform = yes -test-xfail-XOPEN2K/ftw.h/conform = yes test-xfail-XOPEN2K/mqueue.h/conform = yes -test-xfail-XOPEN2K/netinet/in.h/conform = yes -test-xfail-XOPEN2K/sys/sem.h/conform = yes -test-xfail-XOPEN2K/sys/uio.h/conform = yes -test-xfail-XOPEN2K/sys/socket.h/conform = yes test-xfail-XOPEN2K/sys/types.h/conform = yes test-xfail-XOPEN2K/stdlib.h/conform = yes -test-xfail-XOPEN2K/arpa/inet.h/conform = yes -test-xfail-XOPEN2K8/fcntl.h/conform = yes -test-xfail-XOPEN2K8/netdb.h/conform = yes test-xfail-XOPEN2K8/signal.h/conform = yes -test-xfail-XOPEN2K8/semaphore.h/conform = yes test-xfail-XOPEN2K8/regex.h/conform = yes test-xfail-XOPEN2K8/aio.h/conform = yes -test-xfail-XOPEN2K8/ftw.h/conform = yes test-xfail-XOPEN2K8/mqueue.h/conform = yes -test-xfail-XOPEN2K8/netinet/in.h/conform = yes -test-xfail-XOPEN2K8/sys/sem.h/conform = yes -test-xfail-XOPEN2K8/sys/uio.h/conform = yes -test-xfail-XOPEN2K8/sys/socket.h/conform = yes test-xfail-XOPEN2K8/sys/types.h/conform = yes test-xfail-XOPEN2K8/stdlib.h/conform = yes -test-xfail-XOPEN2K8/arpa/inet.h/conform = yes # For bug 23819 test-xfail-ISO11/threads.h/linknamespace = yes diff --git a/sysdeps/mach/hurd/sendfile.c b/sysdeps/mach/hurd/sendfile.c index 1a03dd3e9b..b68cfca1f7 100644 --- a/sysdeps/mach/hurd/sendfile.c +++ b/sysdeps/mach/hurd/sendfile.c @@ -17,6 +17,7 @@ . */ #include +#include #include /* Send COUNT bytes from file associated with IN_FD starting at OFFSET to diff --git a/sysdeps/nptl/proc_service.h b/sysdeps/nptl/proc_service.h index afb27b5b51..6022ef1742 100644 --- a/sysdeps/nptl/proc_service.h +++ b/sysdeps/nptl/proc_service.h @@ -22,6 +22,9 @@ /* The definitions in this file must correspond to those in the debugger. */ #include +#include +#include + __BEGIN_DECLS /* Functions in this interface return one of these status codes. */ diff --git a/sysdeps/nptl/sys/procfs.h b/sysdeps/nptl/sys/procfs.h index d0e0dc4abd..67e33c48ca 100644 --- a/sysdeps/nptl/sys/procfs.h +++ b/sysdeps/nptl/sys/procfs.h @@ -19,7 +19,8 @@ #ifndef _SYS_PROCFS_H #define _SYS_PROCFS_H 1 -#include +#include +#include /* The rest of this file provides the types for emulation of the Solaris interfaces that should be implemented by diff --git a/sysdeps/nptl/thread_db.h b/sysdeps/nptl/thread_db.h index bf073b7d86..da5f2cdc47 100644 --- a/sysdeps/nptl/thread_db.h +++ b/sysdeps/nptl/thread_db.h @@ -24,7 +24,6 @@ with the goal to share the same code in the debugger. */ #include #include -#include #include #include diff --git a/sysdeps/posix/dl-fileid.h b/sysdeps/posix/dl-fileid.h index 7d1e9e4950..39a4bffc67 100644 --- a/sysdeps/posix/dl-fileid.h +++ b/sysdeps/posix/dl-fileid.h @@ -23,8 +23,8 @@ a unique identifier for a file. */ struct r_file_id { - dev_t dev; - ino64_t ino; + __dev_t dev; + __ino64_t ino; }; /* Sample FD to fill in *ID. Returns true on success. diff --git a/sysdeps/powerpc/sys/platform/ppc.h b/sysdeps/powerpc/sys/platform/ppc.h index 335868cb2a..83141903d2 100644 --- a/sysdeps/powerpc/sys/platform/ppc.h +++ b/sysdeps/powerpc/sys/platform/ppc.h @@ -20,24 +20,24 @@ #define _SYS_PLATFORM_PPC_H 1 #include -#include +#include #include /* Read the Time Base Register. */ -static __inline__ uint64_t +static __inline__ __uint64_t __ppc_get_timebase (void) { #if __GNUC_PREREQ (4, 8) return __builtin_ppc_get_timebase (); #else # ifdef __powerpc64__ - uint64_t __tb; + __uint64_t __tb; /* "volatile" is necessary here, because the user expects this assembly isn't moved after an optimization. */ __asm__ volatile ("mfspr %0, 268" : "=r" (__tb)); return __tb; # else /* not __powerpc64__ */ - uint32_t __tbu, __tbl, __tmp; \ + __uint32_t __tbu, __tbl, __tmp; __asm__ volatile ("0:\n\t" "mftbu %0\n\t" "mftbl %1\n\t" @@ -45,7 +45,7 @@ __ppc_get_timebase (void) "cmpw %0, %2\n\t" "bne- 0b" : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp)); - return (((uint64_t) __tbu << 32) | __tbl); + return (((__uint64_t) __tbu << 32) | __tbl); # endif /* not __powerpc64__ */ #endif } diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h index 436d21cb08..2532cc9eec 100644 --- a/sysdeps/pthread/semaphore.h +++ b/sysdeps/pthread/semaphore.h @@ -19,7 +19,7 @@ #define _SEMAPHORE_H 1 #include -#include + #ifdef __USE_XOPEN2K # include #endif diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h b/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h index e0afc7afe7..51571cddaa 100644 --- a/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/aarch64/bits/procfs.h @@ -17,19 +17,28 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif +#include + /* Type for a general-purpose register. */ typedef __uint64_t elf_greg_t; /* And the whole bunch of them. We could have used `struct - pt_regs' directly in the typedef, but tradition says that + user_regs_struct' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar - semantics, so leave it that way. */ + semantics, so leave it that way. + + struct user_regs_struct is defined in sys/user.h. */ #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; /* Register set for the floating-point registers. */ typedef struct user_fpsimd_struct elf_fpregset_t; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h index b9d05398e4..7769b6dd6a 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_EPOLL_H +#define _BITS_EPOLL_H 1 + #ifndef _SYS_EPOLL_H # error "Never use directly; include instead." #endif @@ -25,3 +28,5 @@ enum EPOLL_CLOEXEC = 010000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC }; + +#endif /* bits/epoll.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h b/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h index a5baf1361d..cc74865377 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h @@ -17,9 +17,18 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_PRREGSET_H +#define _BITS_PROCFS_PRREGSET_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif +/* For gregset_t and fpregset_t. FIXME: sys/procfs.h should not + expose all of sys/ucontext.h. */ +#include + typedef gregset_t __prgregset_t; typedef fpregset_t __prfpregset_t; + +#endif diff --git a/sysdeps/unix/sysv/linux/alpha/bits/procfs.h b/sysdeps/unix/sysv/linux/alpha/bits/procfs.h index 9d2500665b..9d546a49fe 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/procfs.h @@ -16,13 +16,13 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -#include -#include - /* * The OSF/1 version of makes gregset_t 46 entries long. * I have no idea why that is so. For now, we just leave it at 33 @@ -36,3 +36,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h index defa3ba2f1..6ae4638802 100644 --- a/sysdeps/unix/sysv/linux/alpha/sys/acct.h +++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h @@ -16,8 +16,8 @@ . */ #ifndef _SYS_ACCT_H - #define _SYS_ACCT_H 1 + #include #include diff --git a/sysdeps/unix/sysv/linux/arm/bits/procfs.h b/sysdeps/unix/sysv/linux/arm/bits/procfs.h index 7d0b30865d..da703d9292 100644 --- a/sysdeps/unix/sysv/linux/arm/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/arm/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -26,9 +29,13 @@ typedef unsigned long elf_greg_t; /* And the whole bunch of them. We could have used `struct user_regs' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar - semantics, so leave it that way. */ + semantics, so leave it that way. + + struct user_regs is defined in sys/user.h. */ #define ELF_NGREG (sizeof (struct user_regs) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; /* Register set for the floating-point registers. */ typedef struct user_fpregs elf_fpregset_t; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/bits/epoll.h b/sysdeps/unix/sysv/linux/bits/epoll.h index 164b464b2c..1202412cc3 100644 --- a/sysdeps/unix/sysv/linux/bits/epoll.h +++ b/sysdeps/unix/sysv/linux/bits/epoll.h @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_EPOLL_H +#define _BITS_EPOLL_H 1 + #ifndef _SYS_EPOLL_H # error "Never use directly; include instead." #endif @@ -25,3 +28,5 @@ enum EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC }; + +#endif /* bits/epoll.h */ diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h index e0f4155c67..7bbc7aab87 100644 --- a/sysdeps/unix/sysv/linux/bits/sem.h +++ b/sysdeps/unix/sysv/linux/bits/sem.h @@ -15,11 +15,14 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_SEM_H +#define _BITS_SEM_H 1 + #ifndef _SYS_SEM_H # error "Never include directly; use instead." #endif -#include +#include #include /* Flags for `semop'. */ @@ -95,3 +98,5 @@ struct seminfo }; #endif /* __USE_MISC */ + +#endif /* bits/sem.h */ diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index 65c72198ef..e85fb589ce 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -24,7 +24,7 @@ #endif -#include +#include #include #include @@ -337,9 +337,9 @@ enum /* User visible structure for SCM_CREDENTIALS message */ struct ucred { - pid_t pid; /* PID of sending process. */ - uid_t uid; /* UID of sending process. */ - gid_t gid; /* GID of sending process. */ + __pid_t pid; /* PID of sending process. */ + __uid_t uid; /* UID of sending process. */ + __gid_t gid; /* GID of sending process. */ }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/uio-ext.h b/sysdeps/unix/sysv/linux/bits/uio-ext.h index 85ceacddb4..ca27ffa6e7 100644 --- a/sysdeps/unix/sysv/linux/bits/uio-ext.h +++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h @@ -26,7 +26,7 @@ __BEGIN_DECLS /* Read from another process' address space. */ -extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec, +extern ssize_t process_vm_readv (__pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, @@ -34,7 +34,7 @@ extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec, __THROW; /* Write to another process' address space. */ -extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, +extern ssize_t process_vm_writev (__pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, diff --git a/sysdeps/unix/sysv/linux/csky/bits/procfs.h b/sysdeps/unix/sysv/linux/csky/bits/procfs.h index 2be553eeba..ed084e4acb 100644 --- a/sysdeps/unix/sysv/linux/csky/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/csky/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -35,3 +38,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; #define ELF_NFPREG (sizeof (struct user_fp) / sizeof (elf_fpreg_t)) typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h index 85fb0a9c50..1ba8cdfb48 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_EPOLL_H +#define _BITS_EPOLL_H 1 + #ifndef _SYS_EPOLL_H # error "Never use directly; include instead." #endif @@ -25,3 +28,5 @@ enum EPOLL_CLOEXEC = 010000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC }; + +#endif /* bits/epoll.h */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/procfs.h b/sysdeps/unix/sysv/linux/hppa/bits/procfs.h index 5de27f5b7c..97d8e93dff 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -28,3 +31,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; #define ELF_NFPREG 32 typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/ia64/bits/procfs.h b/sysdeps/unix/sysv/linux/ia64/bits/procfs.h index 6c22aefe5a..45d553c16f 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/procfs.h @@ -16,11 +16,15 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -#include +/* For struct __ia64_fpreg. FIXME: sys/procfs.h should not expose all + of sys/ucontext.h. */ #include #include @@ -39,3 +43,5 @@ typedef elf_greg_t greg_t; typedef elf_gregset_t gregset_t; typedef elf_fpregset_t fpregset_t; #define NGREG ELF_NGREG + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/m68k/bits/procfs.h b/sysdeps/unix/sysv/linux/m68k/bits/procfs.h index d0c06a14f3..ff53e73c76 100644 --- a/sysdeps/unix/sysv/linux/m68k/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/m68k/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -26,9 +29,13 @@ typedef unsigned long elf_greg_t; /* And the whole bunch of them. We could have used `struct user_regs_struct' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar - semantics, so leave it that way. */ + semantics, so leave it that way. + + struct user_regs_struct is defined by sys/user.h. */ #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; /* Register set for the floating-point registers. */ typedef struct user_m68kfp_struct elf_fpregset_t; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h b/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h index a7ba7a3e0b..acee07ff5f 100644 --- a/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/microblaze/bits/procfs.h @@ -17,6 +17,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -27,9 +30,13 @@ typedef unsigned long elf_greg_t; /* And the whole bunch of them. We could have used `struct user_regs_struct' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar - semantics, so leave it that way. */ + semantics, so leave it that way. + + struct user_regs_struct is defined by sys/user.h. */ #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; /* Register set for the floating-point registers. */ typedef struct user_fpregs_struct elf_fpregset_t; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/microblaze/sys/user.h b/sysdeps/unix/sysv/linux/microblaze/sys/user.h index 1ab0bb3f4b..550ef47d02 100644 --- a/sysdeps/unix/sysv/linux/microblaze/sys/user.h +++ b/sysdeps/unix/sysv/linux/microblaze/sys/user.h @@ -17,7 +17,9 @@ . */ #ifndef _SYS_USER_H -# define _SYS_USER_H 1 +#define _SYS_USER_H 1 + +#include #include diff --git a/sysdeps/unix/sysv/linux/mips/bits/epoll.h b/sysdeps/unix/sysv/linux/mips/bits/epoll.h index 164b464b2c..1202412cc3 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/epoll.h +++ b/sysdeps/unix/sysv/linux/mips/bits/epoll.h @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_EPOLL_H +#define _BITS_EPOLL_H 1 + #ifndef _SYS_EPOLL_H # error "Never use directly; include instead." #endif @@ -25,3 +28,5 @@ enum EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC }; + +#endif /* bits/epoll.h */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/procfs.h b/sysdeps/unix/sysv/linux/mips/bits/procfs.h index 86229f6bc4..aa9090cf8d 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/mips/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -35,3 +38,5 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/nios2/bits/procfs.h b/sysdeps/unix/sysv/linux/nios2/bits/procfs.h index ad776a85a1..7d0f5ebd2c 100644 --- a/sysdeps/unix/sysv/linux/nios2/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/nios2/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -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 */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h b/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h index 07c03c9955..cc0e8102b7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h @@ -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 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/procfs.h b/sysdeps/unix/sysv/linux/powerpc/bits/procfs.h index 5c73b39c72..88b795b5c1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/procfs.h @@ -16,17 +16,20 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -#include -#include +#include +#include + +/* 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 */ diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/user.h b/sysdeps/unix/sysv/linux/powerpc/sys/user.h index d22634e108..2833a06600 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sys/user.h +++ b/sysdeps/unix/sysv/linux/powerpc/sys/user.h @@ -22,6 +22,7 @@ #include #include +#include struct user { struct pt_regs regs; /* entire machine state */ diff --git a/sysdeps/unix/sysv/linux/riscv/bits/procfs.h b/sysdeps/unix/sysv/linux/riscv/bits/procfs.h index 7e5b115093..167991f28f 100644 --- a/sysdeps/unix/sysv/linux/riscv/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/riscv/bits/procfs.h @@ -16,10 +16,16 @@ License along with the GNU C Library. If not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif +/* 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 /* 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 */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/procfs.h b/sysdeps/unix/sysv/linux/s390/bits/procfs.h index 4d765aa87a..633b8f6346 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/s390/bits/procfs.h @@ -16,10 +16,15 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif +/* 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 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 */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmp.h b/sysdeps/unix/sysv/linux/s390/bits/utmp.h index ec0ee02303..ffe5a2444d 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h +++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h @@ -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. @@ -16,15 +16,13 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_UTMP_H +#define _BITS_UTMP_H 1 + #ifndef _UTMP_H # error "Never include directly; use instead." #endif -#include -#include -#include -#include - #define UT_LINESIZE 32 #define UT_NAMESIZE 32 @@ -35,11 +33,7 @@ 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 */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h index d68df97bef..3321a29647 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h +++ b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h @@ -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. @@ -16,22 +16,13 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_UTMPX_H +#define _BITS_UTMPX_H 1 + #ifndef _UTMPX_H # error "Never include directly; use instead." #endif -#include -#include -#include - - -#ifdef __USE_GNU -# include -# define _PATH_UTMPX _PATH_UTMP -# define _PATH_WTMPX _PATH_WTMP -#endif - - #define __UT_LINESIZE 32 #define __UT_NAMESIZE 32 #define __UT_HOSTSIZE 256 @@ -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 */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/procfs.h b/sysdeps/unix/sysv/linux/sh/bits/procfs.h index 6b34f0a473..09f65188b9 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/sh/bits/procfs.h @@ -16,9 +16,14 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif /* elf_gregset_t and elf_fpregset_t are defined by sys/user.h for SH. */ + +#endif /* bits/procfs.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/epoll.h b/sysdeps/unix/sysv/linux/sparc/bits/epoll.h index 3c4abb96de..228cce6f1d 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/epoll.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/epoll.h @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_EPOLL_H +#define _BITS_EPOLL_H 1 + #ifndef _SYS_EPOLL_H # error "Never use directly; include instead." #endif @@ -25,3 +28,5 @@ enum EPOLL_CLOEXEC = 0x400000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC }; + +#endif /* bits/epoll.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/procfs.h b/sysdeps/unix/sysv/linux/sparc/bits/procfs.h index ee813139a9..018671b44a 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/procfs.h @@ -16,12 +16,13 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -#include -#include #include #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 */ diff --git a/sysdeps/unix/sysv/linux/sys/acct.h b/sysdeps/unix/sysv/linux/sys/acct.h index 2cae51bfcd..057fd47a24 100644 --- a/sysdeps/unix/sysv/linux/sys/acct.h +++ b/sysdeps/unix/sysv/linux/sys/acct.h @@ -18,10 +18,10 @@ #ifndef _SYS_ACCT_H #define _SYS_ACCT_H 1 -#include -#include +#include + #include -#include +#include __BEGIN_DECLS diff --git a/sysdeps/unix/sysv/linux/sys/epoll.h b/sysdeps/unix/sysv/linux/sys/epoll.h index 3ca6d4820a..2f55076dd5 100644 --- a/sysdeps/unix/sysv/linux/sys/epoll.h +++ b/sysdeps/unix/sysv/linux/sys/epoll.h @@ -18,9 +18,9 @@ #ifndef _SYS_EPOLL_H #define _SYS_EPOLL_H 1 -#include -#include +#include +#include #include /* 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; diff --git a/sysdeps/unix/sysv/linux/sys/eventfd.h b/sysdeps/unix/sysv/linux/sys/eventfd.h index 10515b2a64..fdd46e1582 100644 --- a/sysdeps/unix/sysv/linux/sys/eventfd.h +++ b/sysdeps/unix/sysv/linux/sys/eventfd.h @@ -18,13 +18,14 @@ #ifndef _SYS_EVENTFD_H #define _SYS_EVENTFD_H 1 -#include +#include +#include /* Get the platform-dependent flags. */ #include /* Type for event counter. */ -typedef uint64_t eventfd_t; +typedef __uint64_t eventfd_t; __BEGIN_DECLS diff --git a/sysdeps/unix/sysv/linux/sys/fanotify.h b/sysdeps/unix/sysv/linux/sys/fanotify.h index 84c0a8ba1c..678064f034 100644 --- a/sysdeps/unix/sysv/linux/sys/fanotify.h +++ b/sysdeps/unix/sysv/linux/sys/fanotify.h @@ -18,10 +18,10 @@ #ifndef _SYS_FANOTIFY_H #define _SYS_FANOTIFY_H 1 -#include +#include +#include #include - __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 diff --git a/sysdeps/unix/sysv/linux/sys/fsuid.h b/sysdeps/unix/sysv/linux/sys/fsuid.h index c3977b0aba..bb798b75f9 100644 --- a/sysdeps/unix/sysv/linux/sys/fsuid.h +++ b/sysdeps/unix/sysv/linux/sys/fsuid.h @@ -19,7 +19,7 @@ #define _SYS_FSUID_H 1 #include -#include +#include __BEGIN_DECLS diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h index b57ab82d2f..c22c4e6f66 100644 --- a/sysdeps/unix/sysv/linux/sys/inotify.h +++ b/sysdeps/unix/sysv/linux/sys/inotify.h @@ -18,7 +18,8 @@ #ifndef _SYS_INOTIFY_H #define _SYS_INOTIFY_H 1 -#include +#include +#include /* Get the platform-dependent flags. */ #include @@ -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. */ diff --git a/sysdeps/unix/sysv/linux/sys/procfs.h b/sysdeps/unix/sysv/linux/sys/procfs.h index e432bbf7b1..2d28399089 100644 --- a/sysdeps/unix/sysv/linux/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/sys/procfs.h @@ -30,8 +30,10 @@ GDB unless you know what you are doing. */ #include -#include -#include + +#include +#include + #include /* bits/procfs.h, provided by each architecture, must define diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h index 23f00684b6..b972d3fdba 100644 --- a/sysdeps/unix/sysv/linux/sys/quota.h +++ b/sysdeps/unix/sysv/linux/sys/quota.h @@ -52,8 +52,8 @@ #define _SYS_QUOTA_H 1 #include -#include +#include #include /* diff --git a/sysdeps/unix/sysv/linux/sys/raw.h b/sysdeps/unix/sysv/linux/sys/raw.h index 1bb47a3800..0966d9af99 100644 --- a/sysdeps/unix/sysv/linux/sys/raw.h +++ b/sysdeps/unix/sysv/linux/sys/raw.h @@ -18,7 +18,8 @@ #ifndef _SYS_RAW_H #define _SYS_RAW_H 1 -#include +#include +#include #include /* 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 */ diff --git a/sysdeps/unix/sysv/linux/sys/signalfd.h b/sysdeps/unix/sysv/linux/sys/signalfd.h index bbaac7bd2b..e8fa358289 100644 --- a/sysdeps/unix/sysv/linux/sys/signalfd.h +++ b/sysdeps/unix/sysv/linux/sys/signalfd.h @@ -18,7 +18,8 @@ #ifndef _SYS_SIGNALFD_H #define _SYS_SIGNALFD_H 1 -#include +#include +#include #include /* Get the platform-dependent flags. */ @@ -26,28 +27,28 @@ 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 diff --git a/sysdeps/unix/sysv/linux/x86/bits/epoll.h b/sysdeps/unix/sysv/linux/x86/bits/epoll.h index 0b34b3d623..079cbf1341 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/epoll.h +++ b/sysdeps/unix/sysv/linux/x86/bits/epoll.h @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_EPOLL_H +#define _BITS_EPOLL_H 1 + #ifndef _SYS_EPOLL_H # error "Never use directly; include instead." #endif @@ -27,3 +30,5 @@ enum }; #define __EPOLL_PACKED __attribute__ ((__packed__)) + +#endif /* bits/epoll.h */ diff --git a/sysdeps/unix/sysv/linux/x86/bits/procfs.h b/sysdeps/unix/sysv/linux/x86/bits/procfs.h index 23012304b9..19c045d64c 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/procfs.h +++ b/sysdeps/unix/sysv/linux/x86/bits/procfs.h @@ -16,6 +16,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _BITS_PROCFS_H +#define _BITS_PROCFS_H 1 + #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif @@ -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 */ diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h index 852c8a0193..519a78a799 100644 --- a/sysvipc/sys/sem.h +++ b/sysvipc/sys/sem.h @@ -25,6 +25,8 @@ /* Define types required by the standard. */ #include +#include +#include #ifdef __USE_GNU # include #endif -- cgit v1.2.3