loader/pthread: Added pthread_attr_get_np support.
diff --git a/configure b/configure
index 254ec3b..114bead 100755
--- a/configure
+++ b/configure
@@ -8339,6 +8339,7 @@
+
for ac_header in \
AudioUnit/AudioUnit.h \
CoreAudio/CoreAudio.h \
@@ -8393,6 +8394,7 @@
poll.h \
process.h \
pthread.h \
+ pthread_np.h \
pwd.h \
regex.h \
sched.h \
@@ -13955,7 +13957,9 @@
+
for ac_func in \
+ pthread_attr_get_np \
pthread_getattr_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np
diff --git a/configure.ac b/configure.ac
index 963746f..8f7ae2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,7 @@
poll.h \
process.h \
pthread.h \
+ pthread_np.h \
pwd.h \
regex.h \
sched.h \
@@ -779,6 +780,7 @@
dnl **** Check for pthread functions ****
WINE_CHECK_LIB_FUNCS(\
+ pthread_attr_get_np \
pthread_getattr_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np,
diff --git a/include/config.h.in b/include/config.h.in
index 3d1d4b5..5cb7384 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -521,6 +521,9 @@
/* Define to 1 if you have the <process.h> header file. */
#undef HAVE_PROCESS_H
+/* Define to 1 if you have the `pthread_attr_get_np' function. */
+#undef HAVE_PTHREAD_ATTR_GET_NP
+
/* Define to 1 if you have the `pthread_getattr_np' function. */
#undef HAVE_PTHREAD_GETATTR_NP
@@ -533,6 +536,9 @@
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
+/* Define to 1 if you have the <pthread_np.h> header file. */
+#undef HAVE_PTHREAD_NP_H
+
/* Define to 1 if the system has the type `pthread_rwlockattr_t'. */
#undef HAVE_PTHREAD_RWLOCKATTR_T
diff --git a/include/wine/pthread.h b/include/wine/pthread.h
index 69a1562..1971ebb 100644
--- a/include/wine/pthread.h
+++ b/include/wine/pthread.h
@@ -29,6 +29,9 @@
#define _GNU_SOURCE
#include <pthread.h>
+#ifdef HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
#ifndef HAVE_PTHREAD_RWLOCK_T
typedef void *pthread_rwlock_t;
diff --git a/loader/pthread.c b/loader/pthread.c
index a976c4f..526633e 100644
--- a/loader/pthread.c
+++ b/loader/pthread.c
@@ -70,6 +70,12 @@
pthread_getattr_np( pthread_self(), &attr );
pthread_attr_getstack( &attr, &info->stack_base, &info->stack_size );
pthread_attr_destroy( &attr );
+#elif defined(HAVE_PTHREAD_ATTR_GET_NP)
+ pthread_attr_t attr;
+ pthread_attr_init( &attr );
+ pthread_attr_get_np( pthread_self(), &attr );
+ pthread_attr_getstack( &attr, &info->stack_base, &info->stack_size );
+ pthread_attr_destroy( &attr );
#elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
char dummy;
info->stack_size = pthread_get_stacksize_np(pthread_self());