Module Name: src Committed By: manu Date: Fri May 29 07:37:32 UTC 2015
Modified Files: src/include: limits.h src/lib/libpthread: pthread.c pthread_int.h pthread_key_create.3 pthread_tsd.c src/lib/libpthread_dbg: pthread_dbg.c Log Message: Make PTHREAD_KEYS_MAX dynamically adjustable NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to other systems like Linux (1024) or MacOS X (512). As a result some setups tested on Linux will exhibit problems on NetBSD because of pthread_keys usage beyond the limit. This happens for instance on Apache with various module loaded, and in this case no particular developper can be blamed for going beyond the limit, since several modules from different sources contribute to the problem. This patch makes the limit conigurable through the PTHREAD_KEYS_MAX environement variable. If undefined, the default remains unchanged (256). In any case, the value cannot be lowered below POSIX-mandated _POSIX_THREAD_KEYS_MAX (128). While there: - use EXIT_FAILURE instead of 1 when calling err(3) in libpthread. - Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/include/limits.h cvs rdiff -u -r1.145 -r1.146 src/lib/libpthread/pthread.c cvs rdiff -u -r1.90 -r1.91 src/lib/libpthread/pthread_int.h cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/pthread_key_create.3 cvs rdiff -u -r1.11 -r1.12 src/lib/libpthread/pthread_tsd.c cvs rdiff -u -r1.42 -r1.43 src/lib/libpthread_dbg/pthread_dbg.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.