[Asterisk-code-review] main/utils: Implement ast_get_tid() for NetBSD (asterisk[16])

Friendly Automation asteriskteam at digium.com
Wed Jan 19 11:39:33 CST 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17906 )

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(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



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/+/17906
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: If57fd3f9ea15ef5d010bfbdcbbbae9b379f72f8c
Gerrit-Change-Number: 17906
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Michał Górny <mgorny at NetBSD.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220119/7ea2a6ee/attachment-0001.html>


More information about the asterisk-code-review mailing list