From 39906a3e2c0811b6097ec53cbe7b4d9f2321315e Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Mon, 10 Jun 2019 11:34:41 -0400 Subject: Don’t include signal.h from sys/wait.h or sys/param.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- sysdeps/unix/sysv/linux/alpha/bits/signum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/alpha/bits/signum.h') 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 directly; use instead." #endif -- cgit 1.4.1