On Tue, Jan 26, 2021 at 11:47:59PM +0100, Manuel Bouyer wrote: > 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 >
I would add: Suggested-by: Andrew Cooper <andrew.coop...@citrix.com> > Signed-off-by: Manuel Bouyer <bou...@netbsd.org> Reviewed-by: Roger Pau Monné <roger....@citrix.com> > --- > tools/libs/store/xs.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c > index 4ac73ec317..b6ecbd787e 100644 > --- a/tools/libs/store/xs.c > +++ b/tools/libs/store/xs.c > @@ -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) There was also a suggestion to use MAX(PTHREAD_STACK_MIN, DEFAULT_THREAD_STACKSIZE). Is maybe MAX not defied here? Thanks, Roger.