From 9c877c0df6c700897e160c3f75cc127affb70ff5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 29 May 1996 18:46:46 +0000 Subject: [PATCH] addressed minimum stack size attribute. There is a potential problem if setting PTHREAD_STACK_MIN to 0 does not work with all applications since it is in limit.h over in newlib. There is a potential build order issue with newlib needing to know the rtems cpu dependent stack size minimum. --- c/src/exec/posix/src/pthread.c | 5 ++++- cpukit/posix/src/pthread.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/c/src/exec/posix/src/pthread.c b/c/src/exec/posix/src/pthread.c index 1296af9e70..2f26b5f58e 100644 --- a/c/src/exec/posix/src/pthread.c +++ b/c/src/exec/posix/src/pthread.c @@ -450,7 +450,10 @@ int pthread_attr_setstacksize( if ( !attr || !attr->is_initialized ) return EINVAL; - attr->stacksize = stacksize; + if ( stacksize < STACK_MINIMUM_SIZE ) + attr->stacksize = STACK_MINIMUM_SIZE; + else + attr->stacksize = stacksize; return 0; } diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 1296af9e70..2f26b5f58e 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -450,7 +450,10 @@ int pthread_attr_setstacksize( if ( !attr || !attr->is_initialized ) return EINVAL; - attr->stacksize = stacksize; + if ( stacksize < STACK_MINIMUM_SIZE ) + attr->stacksize = STACK_MINIMUM_SIZE; + else + attr->stacksize = stacksize; return 0; }