changeset 6508:10acfe2761d0

. Use the actual lwp API from userland rather than resorting to SYSCALL on NetBSD. . Since gcc 4.8+ warns about the use of #if and undefined variables, use the equivalent #ifdef constructs instead. Authored by: Christos Zoulas <christos@zoulas.com>
author Greg Lewis <glewis@eyesbeyond.com>
date Sat, 14 Mar 2015 10:19:52 -0700
parents abd0975a3021
children 8ebc41d8f3b8
files src/os/bsd/vm/os_bsd.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/bsd/vm/os_bsd.cpp	Sat Mar 14 10:18:22 2015 -0700
+++ b/src/os/bsd/vm/os_bsd.cpp	Sat Mar 14 10:19:52 2015 -0700
@@ -116,6 +116,10 @@
 # include <elf.h>
 #endif
 
+#ifdef __NetBSD__
+#include <lwp.h>
+#endif
+
 #ifdef __APPLE__
 # include <mach/mach.h> // semaphore_* API
 # include <mach-o/dyld.h>
@@ -1236,7 +1240,7 @@
   guarantee(retval != 0, "just checking");
   return retval;
 
-#elif __FreeBSD__
+#elifdef __FreeBSD__
 #if __FreeBSD_version > 900030
   return ::pthread_getthreadid_np();
 #else
@@ -1244,10 +1248,10 @@
   thr_self(&tid);
   return (pid_t)tid;
 #endif
-#elif __OpenBSD__
+#elifdef __OpenBSD__
   retval = syscall(SYS_getthrid);
-#elif __NetBSD__
-  retval = (pid_t) syscall(SYS__lwp_self);
+#elifdef __NetBSD__
+  retval = (pid_t) _lwp_self();
 #endif
 
   if (retval == -1) {