X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap_r%2Fthr_posix.c;h=8c3d98552555200c05e472a7b8da092410af29d3;hb=29833786ada3dc4c56f16edce84da8eb96d94ed9;hp=2a770f33154c26b374e9d7b32f3b8d78a21ecae6;hpb=01f4aeac4c9ccc42a998c18f8995ce453d819b13;p=openldap diff --git a/libraries/libldap_r/thr_posix.c b/libraries/libldap_r/thr_posix.c index 2a770f3315..8c3d985525 100644 --- a/libraries/libldap_r/thr_posix.c +++ b/libraries/libldap_r/thr_posix.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2013 The OpenLDAP Foundation. + * Copyright 1998-2017 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,8 @@ #include "ldap_thr_debug.h" /* May rename the symbols defined below */ #include /* For pthread_kill() */ +extern int ldap_int_stackguard; + #if HAVE_PTHREADS < 6 # define LDAP_INT_THREAD_ATTR_DEFAULT pthread_attr_default # define LDAP_INT_THREAD_CONDATTR_DEFAULT pthread_condattr_default @@ -148,6 +150,8 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, #ifdef LDAP_PVT_THREAD_SET_STACK_SIZE /* 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 #if HAVE_PTHREADS > 5