--- sal/osl/unx/thread.c.orig.port	Wed Oct  1 12:04:58 2008
+++ sal/osl/unx/thread.c	Thu May  7 23:14:17 2009
@@ -30,6 +30,7 @@
 
 #include "system.h"
 #include <string.h>
+#include <sched.h>
 #include <osl/diagnose.h>
 #include <osl/thread.h>
 #include <osl/nlsupport.h>
@@ -284,6 +285,7 @@ static oslThread osl_thread_create_Impl (
 {
 	Thread_Impl* pImpl;
     int nRet=0;
+    pthread_attr_t attr;
 
 	pImpl = osl_thread_construct_Impl();
     if (!pImpl)
@@ -295,9 +297,18 @@ 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)
 	{
@@ -309,6 +320,8 @@ static oslThread osl_thread_create_Impl (
 
 		return (0);
 	}
+
+	pthread_attr_destroy(&attr);
 
 	/* wait for change from STARTUP to ACTIVE state */
 	while (pImpl->m_Flags & THREADIMPL_FLAGS_STARTUP)
