Fix siginterrupt namespace (bug 21597)

Message ID alpine.DEB.2.20.1706141616440.14610@digraph.polyomino.org.uk
State New, archived
Headers

Commit Message

Joseph Myers June 14, 2017, 4:17 p.m. UTC
  The siginterrupt function is XSI-shaded in POSIX.  glibc wrongly
declares it in <signal.h> for non-XSI POSIX.1:2008.  This patch,
relative to a tree with
<https://sourceware.org/ml/libc-alpha/2017-06/msg00582.html> (pending
review) applied, fixes the conditionals (moving it into the
__USE_XOPEN_EXTENDED || __USE_MISC block as the minimum conservative
change, although it's not clear this obsolescent function should be
declared by default).

Tested for x86_64.

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

	[BZ #21597]
	* signal/signal.h (siginterrupt): Make declaration conditional on
	[__USE_XOPEN_EXTENDED || __USE_MISC].
  

Comments

Joseph Myers June 19, 2017, 11:12 a.m. UTC | #1
Ping.  This patch 
<https://sourceware.org/ml/libc-alpha/2017-06/msg00613.html> is pending 
review.
  
Andreas Schwab June 19, 2017, 12:14 p.m. UTC | #2
On Jun 14 2017, Joseph Myers <joseph@codesourcery.com> wrote:

> 	[BZ #21597]
> 	* signal/signal.h (siginterrupt): Make declaration conditional on
> 	[__USE_XOPEN_EXTENDED || __USE_MISC].

Ok.

Andreas.
  

Patch

diff --git a/signal/signal.h b/signal/signal.h
index 8dfe849..ddb79c7 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -296,11 +296,6 @@  extern int sigreturn (struct sigcontext *__scp) __THROW;
 # define __need_size_t
 # include <stddef.h>
 
-/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
-   (causing them to fail with EINTR); if INTERRUPT is zero, make system
-   calls be restarted after signal SIG.  */
-extern int siginterrupt (int __sig, int __interrupt) __THROW;
-
 # include <bits/types/stack_t.h>
 # if defined __USE_XOPEN || defined __USE_XOPEN2K8
 /* This will define `ucontext_t' and `mcontext_t'.  */
@@ -309,6 +304,11 @@  extern int siginterrupt (int __sig, int __interrupt) __THROW;
 #endif /* Use POSIX.1-2008 or X/Open Unix.  */
 
 #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
+/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
+   (causing them to fail with EINTR); if INTERRUPT is zero, make system
+   calls be restarted after signal SIG.  */
+extern int siginterrupt (int __sig, int __interrupt) __THROW;
+
 # include <bits/sigstack.h>
 # include <bits/ss_flags.h>