Skip to content
Snippets Groups Projects
Commit c8ef232d authored by Michał Górny's avatar Michał Górny Committed by Friendly Automation
Browse files

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
parent 7b1e5fa3
No related branches found
No related tags found
1 merge request!48asterisk uplift to 18.11.2
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <unistd.h> #include <unistd.h>
#if defined(__APPLE__) #if defined(__APPLE__)
#include <mach/mach.h> #include <mach/mach.h>
#elif defined(__NetBSD__)
#include <lwp.h>
#elif defined(HAVE_SYS_THR_H) #elif defined(HAVE_SYS_THR_H)
#include <sys/thr.h> #include <sys/thr.h>
#endif #endif
...@@ -2659,6 +2661,8 @@ int ast_get_tid(void) ...@@ -2659,6 +2661,8 @@ int ast_get_tid(void)
long lwpid; long lwpid;
thr_self(&lwpid); /* available since sys/thr.h creation 2003 */ thr_self(&lwpid); /* available since sys/thr.h creation 2003 */
ret = lwpid; ret = lwpid;
#elif defined(__NetBSD__)
ret = _lwp_self();
#endif #endif
return ret; return ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment