From 6dc27eba0cf91c1f7180064a1b31e96151a287be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 15 Aug 2008 15:00:26 +0000 Subject: [PATCH] * As requested by POSIX, we now have PTHREAD_STACK_MIN, and PTHREAD_KEYS_MAX defined in limits.h. * This closes ticket #2559. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26982 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/limits.h | 2 ++ src/system/libroot/posix/pthread/pthread_attr.c | 3 ++- src/system/libroot/posix/pthread/pthread_key.cpp | 1 + src/system/libroot/posix/pthread/pthread_private.h | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/headers/posix/limits.h b/headers/posix/limits.h index ea34ee8507..9732efba3c 100644 --- a/headers/posix/limits.h +++ b/headers/posix/limits.h @@ -41,6 +41,8 @@ #define PAGESIZE (4096) #define PATH_MAX (1024) #define PIPE_MAX (512) +#define PTHREAD_KEYS_MAX 256 +#define PTHREAD_STACK_MIN 4096 #define SSIZE_MAX (2147483647L) #define TTY_NAME_MAX (256) #define TZNAME_MAX (32) diff --git a/src/system/libroot/posix/pthread/pthread_attr.c b/src/system/libroot/posix/pthread/pthread_attr.c index 3c73190d43..7ffc1c87aa 100644 --- a/src/system/libroot/posix/pthread/pthread_attr.c +++ b/src/system/libroot/posix/pthread/pthread_attr.c @@ -8,6 +8,7 @@ #include #include "pthread_private.h" +#include #include #include @@ -102,7 +103,7 @@ pthread_attr_setstacksize(pthread_attr_t *_attr, size_t stacksize) if (_attr == NULL || (attr = *_attr) == NULL) return B_BAD_VALUE; - if (stacksize < MIN_USER_STACK_SIZE || stacksize > MAX_USER_STACK_SIZE) + if (stacksize < PTHREAD_STACK_MIN || stacksize > MAX_USER_STACK_SIZE) return B_BAD_VALUE; attr->stack_size = stacksize; diff --git a/src/system/libroot/posix/pthread/pthread_key.cpp b/src/system/libroot/posix/pthread/pthread_key.cpp index 81e222e232..956c98018b 100644 --- a/src/system/libroot/posix/pthread/pthread_key.cpp +++ b/src/system/libroot/posix/pthread/pthread_key.cpp @@ -6,6 +6,7 @@ #include "pthread_private.h" +#include #include diff --git a/src/system/libroot/posix/pthread/pthread_private.h b/src/system/libroot/posix/pthread/pthread_private.h index 49be81c7a4..29ce14edfb 100644 --- a/src/system/libroot/posix/pthread/pthread_private.h +++ b/src/system/libroot/posix/pthread/pthread_private.h @@ -47,7 +47,6 @@ struct pthread_key_data { void *value; }; -#define PTHREAD_KEYS_MAX 256 #define PTHREAD_UNUSED_SEQUENCE 0 typedef struct _pthread_thread {