summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-06-05 18:03:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-05 18:03:45 +0000
commit431aa4dc9282e23231ba9243f43fd3d49b5f88b3 (patch)
tree06109b7334bace518e53cd8c0b6bbf3c590839c0
parent8aabecf35c71a8255db259cba01005eea10485cf (diff)
parent205dd7d9b3ba314ef8601e4613823c2d62a0605b (diff)
downloadbionic-431aa4dc9282e23231ba9243f43fd3d49b5f88b3.zip
bionic-431aa4dc9282e23231ba9243f43fd3d49b5f88b3.tar.gz
bionic-431aa4dc9282e23231ba9243f43fd3d49b5f88b3.tar.bz2
Merge "Remove bsd_signal and sysv_signal from bionic LP64."
-rw-r--r--libc/bionic/ndk_cruft.cpp12
-rw-r--r--libc/bionic/signal.cpp17
-rw-r--r--libc/include/signal.h2
3 files changed, 19 insertions, 12 deletions
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index ed60ea4..cb9c9c9 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -32,6 +32,7 @@
#include <ctype.h>
#include <inttypes.h>
#include <pthread.h>
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>
@@ -226,4 +227,15 @@ extern "C" wchar_t* wcswcs(wchar_t* haystack, wchar_t* needle) {
return wcsstr(haystack, needle);
}
+// This was removed from POSIX 2008.
+extern "C" sighandler_t bsd_signal(int signum, sighandler_t handler) {
+ return signal(signum, handler);
+}
+
+// sysv_signal() was never in POSIX.
+extern sighandler_t _signal(int signum, sighandler_t handler, int flags);
+extern "C" sighandler_t sysv_signal(int signum, sighandler_t handler) {
+ return _signal(signum, handler, SA_RESETHAND);
+}
+
#endif
diff --git a/libc/bionic/signal.cpp b/libc/bionic/signal.cpp
index 48b2e72..66d75bd 100644
--- a/libc/bionic/signal.cpp
+++ b/libc/bionic/signal.cpp
@@ -28,7 +28,12 @@
#include <signal.h>
-static sighandler_t _signal(int signum, sighandler_t handler, int flags) {
+#ifdef __LP64__
+static
+#else
+__LIBC_HIDDEN__
+#endif
+sighandler_t _signal(int signum, sighandler_t handler, int flags) {
struct sigaction sa;
sigemptyset(&sa.sa_mask);
sa.sa_handler = handler;
@@ -41,14 +46,6 @@ static sighandler_t _signal(int signum, sighandler_t handler, int flags) {
return (sighandler_t) sa.sa_handler;
}
-sighandler_t bsd_signal(int signum, sighandler_t handler) {
- return _signal(signum, handler, SA_RESTART);
-}
-
-sighandler_t sysv_signal(int signum, sighandler_t handler) {
- return _signal(signum, handler, SA_RESETHAND);
-}
-
sighandler_t signal(int signum, sighandler_t handler) {
- return bsd_signal(signum, handler);
+ return _signal(signum, handler, SA_RESTART);
}
diff --git a/libc/include/signal.h b/libc/include/signal.h
index 45c1cda..0063b24 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -102,8 +102,6 @@ struct sigaction {
extern int sigaction(int, const struct sigaction*, struct sigaction*);
extern sighandler_t signal(int, sighandler_t);
-extern sighandler_t bsd_signal(int, sighandler_t);
-extern sighandler_t sysv_signal(int, sighandler_t);
extern int siginterrupt(int, int);