diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-09-14 19:35:49 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-09-14 19:35:49 +0300 |
commit | d21ebcce833ff10dd1e199a75d523f81b5549b6d (patch) | |
tree | e96ee53e569b0ceb9e42a2fc47ef33a3a77ec2ca | |
parent | a336928e1027af92d0c9bb2ccb369a3f9b53abae (diff) | |
download | unit-d21ebcce833ff10dd1e199a75d523f81b5549b6d.tar.gz unit-d21ebcce833ff10dd1e199a75d523f81b5549b6d.tar.bz2 |
Fixing build with glibc 2.34.
Explicitly using the sysconf() call to obtain the minimum thread stack size
instead of the PTHREAD_STACK_MIN macro.
This closes #576 PR on GitHub.
Diffstat (limited to '')
-rw-r--r-- | docs/changes.xml | 6 | ||||
-rw-r--r-- | src/nxt_conf_validation.c | 7 | ||||
-rw-r--r-- | src/nxt_thread.h | 8 |
3 files changed, 10 insertions, 11 deletions
diff --git a/docs/changes.xml b/docs/changes.xml index 5ea0080b..4519f6e9 100644 --- a/docs/changes.xml +++ b/docs/changes.xml @@ -31,6 +31,12 @@ NGINX Unit updated to 1.26.0. date="" time="" packager="Andrei Belov <defan@nginx.com>"> +<change type="bugfix"> +<para> +fixed building with glibc 2.34, notably Fedora 35. +</para> +</change> + </changes> diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c index a53fff74..18c2d478 100644 --- a/src/nxt_conf_validation.c +++ b/src/nxt_conf_validation.c @@ -1733,14 +1733,15 @@ static nxt_int_t nxt_conf_vldt_thread_stack_size(nxt_conf_validation_t *vldt, nxt_conf_value_t *value, void *data) { - int64_t size; + int64_t size, min_size; size = nxt_conf_get_number(value); + min_size = sysconf(_SC_THREAD_STACK_MIN); - if (size < NXT_THREAD_STACK_MIN) { + if (size < min_size) { return nxt_conf_vldt_error(vldt, "The \"thread_stack_size\" number " "must be equal to or greater than %d.", - NXT_THREAD_STACK_MIN); + min_size); } if ((size % nxt_pagesize) != 0) { diff --git a/src/nxt_thread.h b/src/nxt_thread.h index d7800cc6..2ebc331d 100644 --- a/src/nxt_thread.h +++ b/src/nxt_thread.h @@ -142,14 +142,6 @@ nxt_thread_yield() \ #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 { nxt_log_t *log; nxt_log_t main_log; |