mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-23 21:19:09 +00:00
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
This commit is contained in:
committed by
Friendly Automation
parent
dda02b8979
commit
2b490787eb
@@ -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)
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user