summaryrefslogtreecommitdiff
path: root/signal
diff options
context:
space:
mode:
Diffstat (limited to 'signal')
-rw-r--r--signal/Makefile3
-rw-r--r--signal/bits/types/__sigval_t.h41
-rw-r--r--signal/bits/types/sigval_t.h21
-rw-r--r--signal/signal.h4
4 files changed, 60 insertions, 9 deletions
diff --git a/signal/Makefile b/signal/Makefile
index 8c9a7d1844..a6a1289437 100644
--- a/signal/Makefile
+++ b/signal/Makefile
@@ -30,7 +30,8 @@ headers := signal.h sys/signal.h \
bits/types/__sigset_t.h bits/types/sig_atomic_t.h \
bits/types/sigevent_t.h bits/types/siginfo_t.h \
bits/types/sigset_t.h bits/types/sigval_t.h \
- bits/types/stack_t.h bits/types/struct_sigstack.h
+ bits/types/stack_t.h bits/types/struct_sigstack.h \
+ bits/types/__sigval_t.h
routines := signal raise killpg \
sigaction sigprocmask kill \
diff --git a/signal/bits/types/__sigval_t.h b/signal/bits/types/__sigval_t.h
new file mode 100644
index 0000000000..79b4ffe401
--- /dev/null
+++ b/signal/bits/types/__sigval_t.h
@@ -0,0 +1,41 @@
+/* Define __sigval_t.
+ Copyright (C) 1997-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef ____sigval_t_defined
+#define ____sigval_t_defined
+
+/* Type for data associated with a signal. */
+#ifdef __USE_POSIX199309
+union sigval
+{
+ int sival_int;
+ void *sival_ptr;
+};
+
+typedef union sigval __sigval_t;
+#else
+union __sigval
+{
+ int __sival_int;
+ void *__sival_ptr;
+};
+
+typedef union __sigval __sigval_t;
+#endif
+
+#endif
diff --git a/signal/bits/types/sigval_t.h b/signal/bits/types/sigval_t.h
index 666598f0ca..a05d7f469f 100644
--- a/signal/bits/types/sigval_t.h
+++ b/signal/bits/types/sigval_t.h
@@ -1,13 +1,18 @@
#ifndef __sigval_t_defined
#define __sigval_t_defined
-/* Type for data associated with a signal. */
-union sigval
-{
- int sival_int;
- void *sival_ptr;
-};
-
-typedef union sigval sigval_t;
+#include <bits/types/__sigval_t.h>
+
+/* To avoid sigval_t (not a standard type name) having C++ name
+ mangling depending on whether the selected standard includes union
+ sigval, it should not be defined at all when using a standard for
+ which the sigval name is not reserved; in that case, headers should
+ not include <bits/types/sigval_t.h> and should use only the
+ internal __sigval_t name. */
+#ifndef __USE_POSIX199309
+# error "sigval_t defined for standard not including union sigval"
+#endif
+
+typedef __sigval_t sigval_t;
#endif
diff --git a/signal/signal.h b/signal/signal.h
index c8f6100ac4..416c5a252a 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -58,6 +58,10 @@ typedef __uid_t uid_t;
# include <bits/siginfo-consts.h>
#endif
+#ifdef __USE_MISC
+# include <bits/types/sigval_t.h>
+#endif
+
#ifdef __USE_POSIX199309
# include <bits/types/sigevent_t.h>
# include <bits/sigevent-consts.h>