]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
libs/store: make build without PTHREAD_STACK_MIN
authorManuel Bouyer <bouyer@netbsd.org>
Tue, 26 Jan 2021 22:47:59 +0000 (23:47 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Jan 2021 22:50:08 +0000 (22:50 +0000)
On NetBSD, PTHREAD_STACK_MIN is not available.
If PTHREAD_STACK_MIN is not defined, define it to 0 so that we fallback to
DEFAULT_THREAD_STACKSIZE

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
tools/libs/store/xs.c

index 4ac73ec3178a53a6a2fc3116cbafe29adf06a32b..b6ecbd787e70fcfcb40269859e08ef52e44b8bc1 100644 (file)
@@ -811,6 +811,11 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 
 #ifdef USE_PTHREAD
 #define DEFAULT_THREAD_STACKSIZE (16 * 1024)
+/* NetBSD doesn't have PTHREAD_STACK_MIN. */
+#ifndef PTHREAD_STACK_MIN
+# define PTHREAD_STACK_MIN 0
+#endif
+
 #define READ_THREAD_STACKSIZE                                  \
        ((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ?       \
        PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE)