diff options
author | Vitaly Buka <vitalybuka@google.com> | 2017-11-10 22:41:52 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2017-11-10 22:41:52 +0000 |
commit | 6ca78590b388a5b7cb55d8836b7c5082153062ff (patch) | |
tree | 167a51ee74baaeeb1edf07d392073d65174e571a /lib/sanitizer_common/sanitizer_platform_limits_posix.h | |
parent | 8357d02f2d4f6c22202fb25f3b4c97fb2b893ec9 (diff) |
[tsan] Move out more types to sanitizer_common
https://github.com/google/sanitizers/issues/637
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_platform_limits_posix.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_platform_limits_posix.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h index 9fa5b51ec..c593586ab 100644 --- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h @@ -599,13 +599,17 @@ namespace __sanitizer { u64 opaque[128 / sizeof(u64)]; }; + using __sanitizer_sighandler_ptr = void (*)(int sig); + using __sanitizer_sigactionhandler_ptr = + void (*)(int sig, __sanitizer_siginfo *siginfo, void *uctx); + // Linux system headers define the 'sa_handler' and 'sa_sigaction' macros. #if SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) struct __sanitizer_sigaction { unsigned sa_flags; union { - void (*sigaction)(int sig, __sanitizer_siginfo *siginfo, void *uctx); - void (*handler)(int sig); + __sanitizer_sigactionhandler_ptr sigaction; + __sanitizer_sighandler_ptr handler; }; __sanitizer_sigset_t sa_mask; void (*sa_restorer)(); @@ -614,16 +618,16 @@ namespace __sanitizer { struct __sanitizer_sigaction { unsigned sa_flags; union { - void (*sigaction)(int sig, __sanitizer_siginfo *siginfo, void *uctx); - void (*handler)(int sig); + __sanitizer_sigactionhandler_ptr sigaction; + __sanitizer_sighandler_ptr handler; }; __sanitizer_sigset_t sa_mask; }; #elif SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32) struct __sanitizer_sigaction { union { - void (*sigaction)(int sig, __sanitizer_siginfo *siginfo, void *uctx); - void (*handler)(int sig); + __sanitizer_sigactionhandler_ptr sigaction; + __sanitizer_sighandler_ptr handler; }; __sanitizer_sigset_t sa_mask; uptr sa_flags; @@ -635,8 +639,8 @@ namespace __sanitizer { unsigned int sa_flags; #endif union { - void (*sigaction)(int sig, __sanitizer_siginfo *siginfo, void *uctx); - void (*handler)(int sig); + __sanitizer_sigactionhandler_ptr sigaction; + __sanitizer_sighandler_ptr handler; }; #if SANITIZER_FREEBSD int sa_flags; @@ -712,9 +716,10 @@ namespace __sanitizer { }; #endif - extern uptr sig_ign; - extern uptr sig_dfl; - extern uptr sa_siginfo; + extern const uptr sig_ign; + extern const uptr sig_dfl; + extern const uptr sig_err; + extern const uptr sa_siginfo; #if SANITIZER_LINUX extern int e_tabsz; |