From c8ef232d76f721e3aacb74a5ba6a00f81206c75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 11 Nov 2021 05:29:44 +0100 Subject: [PATCH] main/utils: Implement ast_get_tid() for NetBSD Implement the ast_get_tid() function for NetBSD system. NetBSD supports getting the TID via _lwp_self(). ASTERISK-29850 Change-Id: If57fd3f9ea15ef5d010bfbdcbbbae9b379f72f8c --- main/utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/utils.c b/main/utils.c index dc94c994d1..29676fafc1 100644 --- a/main/utils.c +++ b/main/utils.c @@ -36,6 +36,8 @@ #include #if defined(__APPLE__) #include +#elif defined(__NetBSD__) +#include #elif defined(HAVE_SYS_THR_H) #include #endif @@ -2659,6 +2661,8 @@ int ast_get_tid(void) long lwpid; thr_self(&lwpid); /* available since sys/thr.h creation 2003 */ ret = lwpid; +#elif defined(__NetBSD__) + ret = _lwp_self(); #endif return ret; }