diff --git a/include/urcu/syscall-compat.h b/include/urcu/syscall-compat.h index d49b9886..51f3bd66 100644 --- a/include/urcu/syscall-compat.h +++ b/include/urcu/syscall-compat.h @@ -16,7 +16,7 @@ #elif defined(__CYGWIN__) || defined(__APPLE__) || \ defined(__FreeBSD__) || defined(__DragonFly__) || \ - defined(__OpenBSD__) + defined(__OpenBSD__) || defined(__NetBSD__) /* Don't include anything on these platforms. */ #else diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h index 575acaf9..2ee0fd4f 100644 --- a/tests/common/thread-id.h +++ b/tests/common/thread-id.h @@ -67,6 +67,14 @@ unsigned long urcu_get_thread_id(void) { return (unsigned long) getthrid(); } +#elif defined(__NetBSD__) +#include + +static inline +unsigned long urcu_get_thread_id(void) +{ + return (unsigned long) _lwp_self(); +} #else # warning "use pid as thread ID" static inline