Support GC_init (and get_stack_base) from non-main thread on NetBSD
authorIvan Maidanski <ivmai@mail.ru>
Mon, 9 Oct 2017 19:17:15 +0000 (22:17 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 9 Oct 2017 19:17:15 +0000 (22:17 +0300)
Now GC_get_[main_]stack_base uses pthread_getattr_np() and
pthread_attr_getstack() to determine the stack base address on NetBSD.

* include/private/gcconfig.h [NETBSD && !NO_PTHREAD_GETATTR_NP]
(HAVE_PTHREAD_GETATTR_NP): Define.

include/private/gcconfig.h

index 7fb63e0..faa3f09 100644 (file)
 
 /* Outline pthread primitives to use in GC_get_[main_]stack_base.       */
 #if ((defined(FREEBSD) && defined(__GLIBC__)) /* kFreeBSD */ \
-     || defined(LINUX) || defined(PLATFORM_ANDROID)) \
+     || defined(LINUX) || defined(NETBSD) || defined(PLATFORM_ANDROID)) \
     && !defined(NO_PTHREAD_GETATTR_NP)
 # define HAVE_PTHREAD_GETATTR_NP 1
 #elif defined(FREEBSD) && !defined(__GLIBC__) \