[llvm-commits] [compiler-rt] r150699 - in /compiler-rt/trunk/lib/asan: asan_interceptors.cc asan_interceptors.h
Alexey Samsonov
samsonov at google.com
Thu Feb 16 09:00:45 PST 2012
Author: samsonov
Date: Thu Feb 16 11:00:45 2012
New Revision: 150699
URL: http://llvm.org/viewvc/llvm-project?rev=150699&view=rev
Log:
AddressSanitizer: revert r150683 - we can't get rid of headers that easily
Modified:
compiler-rt/trunk/lib/asan/asan_interceptors.cc
compiler-rt/trunk/lib/asan/asan_interceptors.h
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=150699&r1=150698&r2=150699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Thu Feb 16 11:00:45 2012
@@ -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 @@
}
#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 @@
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 @@
#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) {
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.h?rev=150699&r1=150698&r2=150699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.h (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.h Thu Feb 16 11:00:45 2012
@@ -24,7 +24,9 @@
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 {
More information about the llvm-commits
mailing list