about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/alpha/bits/signum.h
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-06-10 11:34:41 -0400
committerZack Weinberg <zackw@panix.com>2020-01-08 13:45:44 -0500
commit39906a3e2c0811b6097ec53cbe7b4d9f2321315e (patch)
tree0ca2bfb597ec2277bb2e2139bfb730d97e714c86 /sysdeps/unix/sysv/linux/alpha/bits/signum.h
parentff9bae2f92e83e9655abd8b32021b0d6407ef560 (diff)
downloadglibc-39906a3e2c0811b6097ec53cbe7b4d9f2321315e.tar.gz
glibc-39906a3e2c0811b6097ec53cbe7b4d9f2321315e.tar.xz
glibc-39906a3e2c0811b6097ec53cbe7b4d9f2321315e.zip
Don’t include signal.h from sys/wait.h or sys/param.h.
Besides the snarl of debugger/ucontext interfaces, these are the only
public headers that include signal.h.

sys/wait.h includes signal.h only for the definition of siginfo_t.
We already have a single-type header for that, so use it.  siginfo_t
contains a field whose type is uid_t, but sys/wait.h is not specified
to define uid_t, so, as is already done for pid_t, the conformance
test is modified to expect that field to have type __uid_t instead.

It is not clear what subset of the definitions from signal.h are
actually expected by historical users of sys/param.h; I’ve chosen to
take the comment at face value and cut it down to bits/signum.h, which
supplies _NSIG and all of the SIG* constants.  This requires adjusting
every copy of bits/signum.h to permit inclusion by sys/param.h as well
as signal.h.

While I was at it I moved the comment about sys/param.h being obsolete
from sysdeps/mach/hurd/bits/param.h, where it’s not likely to be seen,
to the top-level sys/param.h, and edited it to give more useful advice.

This patch partially fixes Hurd-specific bug 23088; sys/wait.h is now
conformant.

	* posix/sys/wait.h: Include bits/types/siginfo_t.h, not signal.h.
	* conform/data/sys/wait.h-data: Do not expect a definition of uid_t.

	* malloc/tst-mallocfork.c, nptl/tst-fork4.c, nptl/tst-getpid3.c
	* nptl/tst-mutex9.c, nptl/tst-rwlock12.c
	* resolv/tst-resolv-res_init-skeleton.c
	* sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c:
        Include signal.h.

	* nptl/tst-cancel4.c, rt/tst-mqueue1.c
	* support/tst-support_capture_subprocess.c
	* sysdeps/unix/sysv/linux/tst-align-clone.c:
	Include signal.h.  Sort includes.

	* misc/sys/param.h: Include bits/signum.h, not signal.h.
	Add comment explaining that this header is obsolete, based on
	a similar comment in Hurd bits/param.h.

	* bits/param.h: Add multiple inclusion guard and defensive #error.
	* sysdeps/mach/hurd/bits/param.h: Add multiple inclusion guard.
	Remove comment explaining that this header is obsolete (see above).
	* sysdeps/mach/i386/bits/mach/param.h: Add multiple inclusion guard.
	* sysdeps/unix/sysv/linux/bits/param.h: Add multiple inclusion guard.

	* bits/signum-generic.h, bits/signum.h
	* sysdeps/unix/bsd/bits/signum.h
	* sysdeps/unix/sysv/linux/alpha/bits/signum.h
	* sysdeps/unix/sysv/linux/bits/signum.h
	* sysdeps/unix/sysv/linux/hppa/bits/signum.h
	* sysdeps/unix/sysv/linux/mips/bits/signum.h:
	Allow inclusion by sys/param.h as well as signal.h.

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

        * sysdeps/mach/hurd/i386/Makefile: Remove XFAILs for sys/wait.h.
Diffstat (limited to 'sysdeps/unix/sysv/linux/alpha/bits/signum.h')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/signum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/signum.h b/sysdeps/unix/sysv/linux/alpha/bits/signum.h
index 63add0e3db..1cfa208dbe 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/signum.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/signum.h
@@ -19,7 +19,7 @@
 #ifndef _BITS_SIGNUM_H
 #define _BITS_SIGNUM_H 1
 
-#ifndef _SIGNAL_H
+#if !defined _SIGNAL_H && !defined _SYS_PARAM_H
 #error "Never include <bits/signum.h> directly; use <signal.h> instead."
 #endif