diff mbox series

[22/24] If PTHREAD_STACK_MIN is not defined, use DEFAULT_THREAD_STACKSIZE

Message ID 20201214163623.2127-23-bouyer@netbsd.org (mailing list archive)
State New, archived
Headers show
Series NetBSD fixes | expand

Commit Message

Manuel Bouyer Dec. 14, 2020, 4:36 p.m. UTC
---
 tools/libs/store/xs.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Roger Pau Monne Dec. 29, 2020, 2:57 p.m. UTC | #1
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

I've been told that PTHREAD_STACK_MIN is not designed to be used like
this anyway, and that what we do could be dangerous:

https://lists.freebsd.org/pipermail/freebsd-current/2014-March/048885.html

Please adjust the subject line to mention this applies to
tools/xenstore and a bit of commit message saying it's not available
on NetBSD.

Thanks.
diff mbox series

Patch

diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index 4ac73ec317..8e646b98d6 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -811,9 +811,13 @@  bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 
 #ifdef USE_PTHREAD
 #define DEFAULT_THREAD_STACKSIZE (16 * 1024)
+#ifndef PTHREAD_STACK_MIN
+#define READ_THREAD_STACKSIZE DEFAULT_THREAD_STACKSIZE
+#else
 #define READ_THREAD_STACKSIZE 					\
 	((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ? 	\
 	PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE)
+#endif
 
 	/* We dynamically create a reader thread on demand. */
 	mutex_lock(&h->request_mutex);