public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Fix signal stack namespace (bug 21584)
@ 2017-06-13 21:09 Joseph Myers
  2017-06-19 11:12 ` Ping " Joseph Myers
  2017-06-19 11:57 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Joseph Myers @ 2017-06-13 21:09 UTC (permalink / raw)
  To: libc-alpha

In POSIX.1:2008, various signal stack symbols - sigaltstack, SS_*,
SIGSTKSZ, MINSIGSTKSZ - are all XSI-shaded.  glibc wrongly makes them
visible for non-XSI POSIX.  This patch fixes the conditionals, leaving
the symbols available for __USE_MISC as it seems likely some of them
are widely used and should be visible by default.  (Note that stack_t
is *not* XSI-shaded and so the conditionals on that are correctly
unchanged.)

Tested for x86_64.

2017-06-13  Joseph Myers  <joseph@codesourcery.com>

	[BZ #21584]
	* signal/signal.h: Make includes of <bits/sigstack.h> and
	<bits/ss_flags.h> conditional on [__USE_XOPEN_EXTENDED ||
	__USE_MISC].
	(sigaltstack): Make declaration conditional on
	[__USE_XOPEN_EXTENDED || __USE_MISC].

diff --git a/signal/signal.h b/signal/signal.h
index 23cd8ef..8dfe849 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -301,20 +301,22 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
    calls be restarted after signal SIG.  */
 extern int siginterrupt (int __sig, int __interrupt) __THROW;
 
-# include <bits/sigstack.h>
 # include <bits/types/stack_t.h>
-# include <bits/ss_flags.h>
 # if defined __USE_XOPEN || defined __USE_XOPEN2K8
 /* This will define `ucontext_t' and `mcontext_t'.  */
 #  include <sys/ucontext.h>
 # endif
+#endif /* Use POSIX.1-2008 or X/Open Unix.  */
+
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
+# include <bits/sigstack.h>
+# include <bits/ss_flags.h>
 
 /* Alternate signal handler stack interface.
    This interface should always be preferred over `sigstack'.  */
 extern int sigaltstack (const stack_t *__restrict __ss,
 			stack_t *__restrict __oss) __THROW;
-
-#endif /* Use POSIX.1-2008 or X/Open Unix.  */
+#endif /* __USE_XOPEN_EXTENDED || __USE_MISC */
 
 #if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8)	\
      || defined __USE_MISC)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Ping Re: Fix signal stack namespace (bug 21584)
  2017-06-13 21:09 Fix signal stack namespace (bug 21584) Joseph Myers
@ 2017-06-19 11:12 ` Joseph Myers
  2017-06-19 11:57 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Joseph Myers @ 2017-06-19 11:12 UTC (permalink / raw)
  To: libc-alpha

Ping.  This patch 
<https://sourceware.org/ml/libc-alpha/2017-06/msg00582.html> is pending 
review.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix signal stack namespace (bug 21584)
  2017-06-13 21:09 Fix signal stack namespace (bug 21584) Joseph Myers
  2017-06-19 11:12 ` Ping " Joseph Myers
@ 2017-06-19 11:57 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2017-06-19 11:57 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Jun 13 2017, Joseph Myers <joseph@codesourcery.com> wrote:

> 	[BZ #21584]
> 	* signal/signal.h: Make includes of <bits/sigstack.h> and
> 	<bits/ss_flags.h> conditional on [__USE_XOPEN_EXTENDED ||
> 	__USE_MISC].
> 	(sigaltstack): Make declaration conditional on
> 	[__USE_XOPEN_EXTENDED || __USE_MISC].

Ok.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-19 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-13 21:09 Fix signal stack namespace (bug 21584) Joseph Myers
2017-06-19 11:12 ` Ping " Joseph Myers
2017-06-19 11:57 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).