Index: lib/sanitizer_common/sanitizer_signal_interceptors.inc =================================================================== --- lib/sanitizer_common/sanitizer_signal_interceptors.inc +++ lib/sanitizer_common/sanitizer_signal_interceptors.inc @@ -46,16 +46,22 @@ } #define INIT_SIGNAL COMMON_INTERCEPT_FUNCTION(signal) -INTERCEPTOR(int, sigaction, int signum, const __sanitizer_sigaction *act, - __sanitizer_sigaction *oldact) { +#if SANITIZER_NETBSD +#define sigaction_symname __sigaction14 +#else +#define sigaction_symname sigaction +#endif + +INTERCEPTOR(int, sigaction_symname, int signum, + const __sanitizer_sigaction *act, __sanitizer_sigaction *oldact) { if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return 0; SIGNAL_INTERCEPTOR_SIGACTION_IMPL(signum, act, oldact); } -#define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction) +#define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction_symname) namespace __sanitizer { int real_sigaction(int signum, const void *act, void *oldact) { - return REAL(sigaction)(signum, (const __sanitizer_sigaction *)act, + return REAL(sigaction_symname)(signum, (const __sanitizer_sigaction *)act, (__sanitizer_sigaction *)oldact); } } // namespace __sanitizer Index: lib/tsan/rtl/tsan_interceptors.cc =================================================================== --- lib/tsan/rtl/tsan_interceptors.cc +++ lib/tsan/rtl/tsan_interceptors.cc @@ -2337,7 +2337,7 @@ internal_memset(&act.sa_mask, -1, sizeof(act.sa_mask)); act.sa_flags = 0; __sanitizer_sigaction old; - int res = sigaction(sig, &act, &old); + int res = sigaction_symname(sig, &act, &old); if (res) return (__sanitizer_sighandler_ptr)sig_err; return old.handler; }