Fixing NetBSD compatibility.
Instead of PTHREAD_STACK_MIN define, NetBSD requires to get minimum stack size using sysctl(_SC_THREAD_STACK_MIN). This change originally proposed by Juraj Lutter <juraj@lutter.sk>.
This commit is contained in:
@@ -1459,10 +1459,10 @@ nxt_conf_vldt_thread_stack_size(nxt_conf_validation_t *vldt,
|
|||||||
|
|
||||||
size = nxt_conf_get_number(value);
|
size = nxt_conf_get_number(value);
|
||||||
|
|
||||||
if (size < PTHREAD_STACK_MIN) {
|
if (size < NXT_THREAD_STACK_MIN) {
|
||||||
return nxt_conf_vldt_error(vldt, "The \"thread_stack_size\" number "
|
return nxt_conf_vldt_error(vldt, "The \"thread_stack_size\" number "
|
||||||
"must be equal to or greater than %d.",
|
"must be equal to or greater than %d.",
|
||||||
PTHREAD_STACK_MIN);
|
NXT_THREAD_STACK_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((size % nxt_pagesize) != 0) {
|
if ((size % nxt_pagesize) != 0) {
|
||||||
|
|||||||
@@ -142,6 +142,14 @@ nxt_thread_yield() \
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if (PTHREAD_STACK_MIN)
|
||||||
|
#define NXT_THREAD_STACK_MIN PTHREAD_STACK_MIN
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define NXT_THREAD_STACK_MIN sysconf(_SC_THREAD_STACK_MIN)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
struct nxt_thread_s {
|
struct nxt_thread_s {
|
||||||
nxt_log_t *log;
|
nxt_log_t *log;
|
||||||
nxt_log_t main_log;
|
nxt_log_t main_log;
|
||||||
|
|||||||
Reference in New Issue
Block a user