source: rtems/cpukit/posix/src/pthreadattrsetinheritsched.c @ 0e16fa45

5
Last change on this file since 0e16fa45 was bd5be58f, checked in by Sebastian Huber <sebastian.huber@…>, on 10/10/17 at 05:18:09

posix: Unconditional thread attribute support

Update #2514.

  • Property mode set to 100644
File size: 879 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Function sets the inheritsched Attribute in the attr Argument
5 * @ingroup POSIXAPI
6 */
7
8/*
9 *  13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
10 *
11 *  COPYRIGHT (c) 1989-1999.
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#include <pthread.h>
24#include <errno.h>
25
26int pthread_attr_setinheritsched(
27  pthread_attr_t  *attr,
28  int              inheritsched
29)
30{
31  if ( !attr || !attr->is_initialized )
32    return EINVAL;
33
34  switch ( inheritsched ) {
35    case PTHREAD_INHERIT_SCHED:
36    case PTHREAD_EXPLICIT_SCHED:
37      attr->inheritsched = inheritsched;
38      return 0;
39
40    default:
41      return ENOTSUP;
42  }
43}
Note: See TracBrowser for help on using the repository browser.