$Log$
+ Revision 590.10 2001/12/17 08:00:45 nbryant
+ set the pthreads stack size to 128K because FreeBSD's default of 64K
+ seems too small. fixes crashes under FreeBSD.
+
Revision 590.9 2001/12/16 00:50:14 error
* Added usersupp.lastcall to the parameters returned from the PASS/PAS2
commands in logged_in_response().
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
void create_worker(void) {
int ret;
struct worker_node *n = mallok(sizeof *n);
+ pthread_attr_t attr;
if (n == NULL) {
lprintf(1, "can't allocate worker_node, exiting\n");
return;
}
- if ((ret = pthread_create(&n->tid, NULL, worker_thread, NULL) != 0))
+ if ((ret = pthread_attr_init(&attr))) {
+ lprintf(1, "pthread_attr_init: %s\n", strerror(ret));
+ time_to_die = -1;
+ return;
+ }
+
+ /* we seem to need something bigger than
+ FreeBSD's default of 64K of stack. */
+
+ if ((ret = pthread_attr_setstacksize(&attr, 128 * 1024))) {
+ lprintf(1, "pthread_attr_setstacksize: %s\n", strerror(ret));
+ time_to_die = -1;
+ return;
+ }
+
+ if ((ret = pthread_create(&n->tid, &attr, worker_thread, NULL) != 0))
{
lprintf(1, "Can't create worker thread: %s\n",