[Asterisk-code-review] main/utils: Implement ast_get_tid() for NetBSD (asterisk[18])
Sean Bright
asteriskteam at digium.com
Tue Jan 18 11:47:17 CST 2022
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17907 )
Change subject: main/utils: Implement ast_get_tid() for NetBSD
......................................................................
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
---
M main/utils.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/17907/1
diff --git a/main/utils.c b/main/utils.c
index dc94c99..29676fa 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -36,6 +36,8 @@
#include <unistd.h>
#if defined(__APPLE__)
#include <mach/mach.h>
+#elif defined(__NetBSD__)
+#include <lwp.h>
#elif defined(HAVE_SYS_THR_H)
#include <sys/thr.h>
#endif
@@ -2659,6 +2661,8 @@
long lwpid;
thr_self(&lwpid); /* available since sys/thr.h creation 2003 */
ret = lwpid;
+#elif defined(__NetBSD__)
+ ret = _lwp_self();
#endif
return ret;
}
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17907
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: If57fd3f9ea15ef5d010bfbdcbbbae9b379f72f8c
Gerrit-Change-Number: 17907
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-CC: Michał Górny <mgorny at NetBSD.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220118/5697c100/attachment.html>
More information about the asterisk-code-review
mailing list