Bugzilla – Bug 312560
pthread_attr_setstacksize not available on NetBSD
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by marc@informatik.uni-bremen.de 2003-07-08 12:04:47 MST ---- pthread_attr_setstacksize is optional wrt to the POSIX thread spec. It's not (yet) implemented on NetBSD(-current) and there may be more systems. The attached patch let's configure check for it and only use it if it's available. Index: configure.in =================================================================== RCS file: /mono/mono/configure.in,v retrieving revision 1.148 diff -u -u -b -r1.148 configure.in --- configure.in 2 Jul 2003 08:37:29 -0000 1.148 +++ configure.in 8 Jul 2003 15:58:57 -0000 @@ -469,6 +469,7 @@ AC_MSG_WARN(Using mono_mutex_t for recursive mutexes) AC_DEFINE(USE_MONO_MUTEX) ]) + AC_CHECK_FUNCS(pthread_attr_setstacksize) dnl ******************************** dnl *** Checks for semaphore lib *** Index: mono/io-layer/threads.c =================================================================== RCS file: /mono/mono/mono/io-layer/threads.c,v retrieving revision 1.45 diff -u -u -b -r1.45 threads.c --- mono/io-layer/threads.c 4 Jul 2003 18:45:33 -0000 1.45 +++ mono/io-layer/threads.c 8 Jul 2003 15:59:02 -0000 @@ -238,8 +238,9 @@ * I'm leaving it as 2M until I'm told differently.) */ pthread_attr_init(&attr); +#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE pthread_attr_setstacksize(&attr, 1024*1024*2); - +#endif ret=_wapi_timed_thread_create(&thread_private_handle->thread, &attr, create, start, thread_exit, param, handle); ---- Additional Comments From vargaz@freemail.hu 2003-10-13 14:43:57 MST ---- Fixed in CVS. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>NetBSD 1.6U</cf_op_sys_details> Unknown operating system other. Setting to default OS "Other".