File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
compiler-rt/lib/sanitizer_common Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 28
28
#include " sanitizer_placement_new.h"
29
29
#include " sanitizer_procmaps.h"
30
30
31
+ #if SANITIZER_NETBSD
32
+ #define _RTLD_SOURCE // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
33
+ #endif
34
+
31
35
#include < dlfcn.h> // for dlsym()
32
36
#include < link.h>
33
37
#include < pthread.h>
@@ -412,7 +416,13 @@ uptr ThreadSelf() {
412
416
413
417
#if SANITIZER_NETBSD
414
418
static struct tls_tcb * ThreadSelfTlsTcb () {
415
- return (struct tls_tcb *)_lwp_getprivate ();
419
+ struct tls_tcb *tcb = nullptr ;
420
+ #ifdef __HAVE___LWP_GETTCB_FAST
421
+ tcb = (struct tls_tcb *)__lwp_gettcb_fast ();
422
+ #elif defined(__HAVE___LWP_GETPRIVATE_FAST)
423
+ tcb = (struct tls_tcb *)__lwp_getprivate_fast ();
424
+ #endif
425
+ return tcb;
416
426
}
417
427
418
428
uptr ThreadSelf () {
You can’t perform that action at this time.
0 commit comments