Changeset 1d572eba in rtems


Ignore:
Timestamp:
Oct 27, 2017, 7:03:55 AM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8744498
Parents:
4edcede
git-author:
Sebastian Huber <sebastian.huber@…> (10/27/17 07:03:55)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/28/17 11:09:43)
Message:

posix: Fix pthread_create() with user stack

In case the user provides a stack with address and size, then do not
alter the stack size.

Close #3211.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthreadcreate.c

    r4edcede r1d572eba  
    7878  int                                 schedpolicy = SCHED_RR;
    7979  struct sched_param                  schedparam;
     80  size_t                              stacksize;
    8081  Objects_Name                        name;
    8182  int                                 error;
     
    9798   *        twice the minimum.
    9899   */
    99   if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) )
    100     return EINVAL;
     100  if ( the_attr->stackaddr != NULL ) {
     101    if ( !_Stack_Is_enough(the_attr->stacksize) ) {
     102      return EINVAL;
     103    }
     104
     105    stacksize = the_attr->stacksize;
     106  } else {
     107    stacksize = _POSIX_Threads_Ensure_minimum_stack( the_attr->stacksize );
     108  }
    101109
    102110  #if 0
     
    201209    scheduler,
    202210    the_attr->stackaddr,
    203     _POSIX_Threads_Ensure_minimum_stack(the_attr->stacksize),
     211    stacksize,
    204212    is_fp,
    205213    core_normal_prio,
Note: See TracChangeset for help on using the changeset viewer.