glibc/signal
Joseph Myers 67f0aff0c6 Fix sigval namespace (bug 21944).
XPG4.2 defines the siginfo_t type, but not union sigval or its
contents (which were added in the 1993 edition of POSIX.1), resulting
in namespace violations for sigval, sival_int and sival_ptr for
signal.h and sys/wait.h for that standard because those headers
incorrectly expose those names in that case.

This patch fixes this problem.  The public type in this case is union
sigval, but various places in the headers use the sigval_t name for
it; direct uses of union sigval are already properly guarded or in
headers not in XPG4.2.  Now, sigval_t, although not a standard name,
does seem to be widely used outside glibc.  The approach taken by this
patch is to make installed headers use the name __sigval_t instead.
__sigval_t is then defined to either union sigval or union __sigval
(where union __sigval has __-prefixed member names as well), depending
on whether there are any namespace issues with the union sigval name
and its members.  In the case where union __sigval is used, sigval_t
is not defined at all, to avoid the problem of sigval_t having a C++
mangled name that depends on feature test macros.  sigval_t is still
defined by signal.h if __USE_MISC (reflecting the nonstandard nature
of that name).

Tested for x86_64.

	[BZ #21944]
	* signal/bits/types/__sigval_t.h: New file.
	* signal/Makefile (headers): Add bits/types/__sigval_t.h.
	* signal/bits/types/sigval_t.h: Include <bits/types/__sigval_t.h>
	and define sigval_t using __sigval_t.
	* include/bits/types/__sigval_t.h: New file.
	* bits/types/sigevent_t.h: Include <bits/types/__sigval_t.h>
	instead of <bits/types/__sigval_t.h>.
	(struct sigevent): Use __sigval_t instead of sigval_t.
	* bits/types/siginfo_t.h: Include <bits/types/__sigval_t.h>
	instead of <bits/types/__sigval_t.h>.
	(siginfo_t): Use __sigval_t instead of sigval_t.
	* sysdeps/unix/sysv/linux/bits/types/sigevent_t.h: Include
	<bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>.
	(struct sigevent): Use __sigval_t instead of sigval_t.
	* sysdeps/unix/sysv/linux/bits/types/siginfo_t.h: Include
	<bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>.
	(siginfo_t): Use __sigval_t instead of sigval_t.
	* signal/signal.h [__USE_MISC]: Include <bits/types/sigval_t.h>.
2017-08-16 20:33:59 +00:00
..
bits/types Fix sigval namespace (bug 21944). 2017-08-16 20:33:59 +00:00
sys initial import 1995-02-18 01:27:10 +00:00
Makefile Fix sigval namespace (bug 21944). 2017-08-16 20:33:59 +00:00
Versions Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
allocrtsig.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
kill.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
killpg.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
raise.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigaction.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigaddset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigaltstack.c Fix struct sigaltstack namespace (bug 21517). 2017-06-05 10:17:46 +00:00
sigandset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigblock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigdelset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigempty.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigfillset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
siggetmask.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sighold.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigignore.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigintr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigisempty.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigismem.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
signal.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
signal.h Fix sigval namespace (bug 21944). 2017-08-16 20:33:59 +00:00
sigorset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigpause.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigpending.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigprocmask.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigqueue.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigrelse.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigreturn.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigsetmask.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigsetops.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigstack.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigsuspend.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigtimedwait.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigvec.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigwait.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigwaitinfo.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysv_signal.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-raise.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-signal.c * malloc/memusagestat.c (main): Use return instead of exit to 2000-12-31 10:52:32 +00:00
tst-sigset.c 2003-03-31 Roland McGrath <roland@redhat.com> 2003-04-01 06:49:23 +00:00
tst-sigset2.c [BZ #1951] 2006-04-23 19:05:33 +00:00
tst-sigsimple.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00