blob: 6a968c1dbf8f20ff642aca72c7fa93287077647f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$NetBSD: patch-libraries_libldap_thr__posix.c,v 1.1 2021/08/23 09:58:58 adam Exp $
Fix for systems lacking pthread_attr_setstacksize().
--- libraries/libldap/thr_posix.c.orig 2021-07-27 17:44:47.000000000 +0000
+++ libraries/libldap/thr_posix.c
@@ -25,6 +25,7 @@
#endif
#include <ac/errno.h>
+#include <ac/unistd.h>
#ifdef REPLACE_BROKEN_YIELD
#ifndef HAVE_NANOSLEEP
@@ -161,11 +162,13 @@ ldap_pvt_thread_create( ldap_pvt_thread_
#endif
#ifdef LDAP_PVT_THREAD_SET_STACK_SIZE
+#ifdef _POSIX_THREAD_ATTR_STACKSIZE
/* this should be tunable */
pthread_attr_setstacksize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
if ( ldap_int_stackguard )
pthread_attr_setguardsize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
#endif
+#endif
#if HAVE_PTHREADS > 5
detach = detach ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE;
|