$OpenBSD: patch-sal_osl_unx_thread_c,v 1.4 2007/04/18 13:20:48 kurt Exp $
--- sal/osl/unx/thread.c.orig.port	Thu Jul  6 10:42:32 2006
+++ sal/osl/unx/thread.c	Wed Apr 18 03:46:26 2007
@@ -35,6 +35,7 @@
 
 #include "system.h"
 #include <string.h>
+#include <sched.h>
 
 #ifndef _OSL_DIAGNOSE_H_
 #include <osl/diagnose.h>
@@ -294,6 +295,7 @@ static oslThread osl_thread_create_Impl (
 {
 	Thread_Impl* pImpl;
     int nRet=0;
+    pthread_attr_t attr;
 
 	pImpl = osl_thread_construct_Impl();
     if (!pImpl)
@@ -305,9 +307,17 @@ static oslThread osl_thread_create_Impl (
 
     pthread_mutex_lock (&(pImpl->m_Lock));
 
+	if (pthread_attr_init(&attr) != 0)
+		return (0);
+
+	if (pthread_attr_setstacksize(&attr, 262144) != 0) {
+		pthread_attr_destroy(&attr);
+		return(0);
+	}
+
 	if ((nRet = pthread_create (
 		&(pImpl->m_hThread),
-		PTHREAD_ATTR_DEFAULT,
+		&attr,
 		osl_thread_start_Impl,
 		(void*)(pImpl))) != 0)
 	{
@@ -316,9 +326,11 @@ static oslThread osl_thread_create_Impl (
 
 		pthread_mutex_unlock (&(pImpl->m_Lock));
 		osl_thread_destruct_Impl (&pImpl);
-
+		pthread_attr_destroy(&attr);
 		return (0);
 	}
+
+	pthread_attr_destroy(&attr);
 
 	/* wait for change from STARTUP to ACTIVE state */
 	while (pImpl->m_Flags & THREADIMPL_FLAGS_STARTUP)
