Skip to content

Commit

Permalink
Add NetBSD support.
Browse files Browse the repository at this point in the history
Signed-off-by: Christos Zoulas <[email protected]>
Tested-by: Christos Zoulas <[email protected]>

regtest.out:
============================================================================
Testsuite summary for userspace-rcu 0.15.0
============================================================================
============================================================================
TIME=38:58.39 CPU=597.9% (13605.556u 375.860s) SWAPS=0 (157727+3641680)pf (0i+338o) (1Kc+32Kd)

short_bench.out:
============================================================================
Testsuite summary for userspace-rcu 0.15.0
============================================================================
============================================================================
TIME=1:02:33.91 CPU=716.0% (26438.855u 439.871s) SWAPS=0 (166007+2996145)pf (0i+353o) (0Kc+9Kd)
  • Loading branch information
zoulasc committed Jan 16, 2025
1 parent bfee76a commit d540e2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/urcu/syscall-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/common/thread-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ unsigned long urcu_get_thread_id(void)
{
return (unsigned long) getthrid();
}
#elif defined(__NetBSD__)
#include <lwp.h>

static inline
unsigned long urcu_get_thread_id(void)
{
return (unsigned long) _lwp_self();
}
#else
# warning "use pid as thread ID"
static inline
Expand Down

0 comments on commit d540e2f

Please sign in to comment.