source: rtems/cpukit/posix/src/pthreadattrsetstack.c @ 77fbbd6

5
Last change on this file since 77fbbd6 was 8c5267a, checked in by Sebastian Huber <sebastian.huber@…>, on 10/10/17 at 05:11:29

posix: Simplify pthread_attr_setstack()

Simplify

  • pthread_attr_setstack(), and
  • pthread_attr_setstacksize().

Update #2514.

  • Property mode set to 100644
File size: 793 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Function Sets Thread Creation Stack Attributes in the attr object
5 * @ingroup POSIXAPI
6 */
7
8/*
9 *  16.1.1 Thread Creation Attributes
10 *
11 *  COPYRIGHT (c) 1989-2010.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#if HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
24
25#include <pthread.h>
26#include <errno.h>
27
28int pthread_attr_setstack(
29  pthread_attr_t  *attr,
30  void            *stackaddr,
31  size_t           stacksize
32)
33{
34  if ( !attr || !attr->is_initialized )
35    return EINVAL;
36
37  attr->stacksize = stacksize;
38  attr->stackaddr = stackaddr;
39  return 0;
40}
41#endif
Note: See TracBrowser for help on using the repository browser.