summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-02-16 17:00:45 +0000
committerAlexey Samsonov <samsonov@google.com>2012-02-16 17:00:45 +0000
commitfbb50f19ad7e627dfe6d384050a253a81b834f81 (patch)
treee78c178382d83d42621e4b7678292175da8a2d11 /compiler-rt
parent3fc6e4a7cda90e816cb8213bea927c9067cb6424 (diff)
downloadbcm5719-llvm-fbb50f19ad7e627dfe6d384050a253a81b834f81.tar.gz
bcm5719-llvm-fbb50f19ad7e627dfe6d384050a253a81b834f81.zip
AddressSanitizer: revert r150683 - we can't get rid of headers that easily
llvm-svn: 150699
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/asan/asan_interceptors.cc20
-rw-r--r--compiler-rt/lib/asan/asan_interceptors.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc
index 05fef27f4d8..87b3f676316 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cc
+++ b/compiler-rt/lib/asan/asan_interceptors.cc
@@ -34,11 +34,11 @@
#if defined(__APPLE__)
// FIXME(samsonov): Gradually replace system headers with declarations of
-// intercepted functions. We need these declarations on Mac to get addresses of
-// the functions to intercept.
+// intercepted functions.
+#include <pthread.h>
+#include <signal.h>
#include <string.h>
#include <strings.h>
-
#endif // __APPLE__
namespace __asan {
@@ -218,10 +218,8 @@ static void *asan_thread_start(void *arg) {
}
#ifndef _WIN32
-extern "C"
-int pthread_create(void *thread, const void *attr,
- void *(*start_routine)(void*), void *arg);
-INTERCEPTOR(int, pthread_create, void *thread, const void *attr,
+INTERCEPTOR(int, pthread_create, pthread_t *thread,
+ const pthread_attr_t *attr,
void *(*start_routine)(void*), void *arg) {
GET_STACK_TRACE_HERE(kStackTraceMax);
int current_tid = asanThreadRegistry().GetCurrentTidOrMinusOne();
@@ -239,9 +237,8 @@ INTERCEPTOR(void*, signal, int signum, void *handler) {
return NULL;
}
-extern "C"
-int sigaction(int signum, const void *act, void *oldact);
-INTERCEPTOR(int, sigaction, int signum, const void *act, void *oldact) {
+INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act,
+ struct sigaction *oldact) {
if (!AsanInterceptsSignal(signum)) {
return REAL(sigaction)(signum, act, oldact);
}
@@ -396,7 +393,8 @@ DEFINE_REAL(char*, index, const char *string, int c);
#endif
#ifdef ANDROID
-DEFINE_REAL(int, sigaction, int signum, const void *act, void *oldact);
+DEFINE_REAL(int, sigaction, int signum, const struct sigaction *act,
+ struct sigaction *oldact);
#endif
INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
diff --git a/compiler-rt/lib/asan/asan_interceptors.h b/compiler-rt/lib/asan/asan_interceptors.h
index 1df8daec670..012c9ab3e65 100644
--- a/compiler-rt/lib/asan/asan_interceptors.h
+++ b/compiler-rt/lib/asan/asan_interceptors.h
@@ -24,7 +24,9 @@ DECLARE_REAL(char*, strchr, const char *str, int c);
DECLARE_REAL(size_t, strlen, const char *s);
DECLARE_REAL(char*, strncpy, char *to, const char *from, size_t size);
DECLARE_REAL(size_t, strnlen, const char *s, size_t maxlen);
-DECLARE_REAL(int, sigaction, int signum, const void *act, void *oldact);
+struct sigaction;
+DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act,
+ struct sigaction *oldact);
namespace __asan {
OpenPOWER on IntegriCloud