source: rtems/cpukit/posix/src/sched_getprioritymax.c @ 2df7fcf

5
Last change on this file since 2df7fcf was 2df7fcf, checked in by Sebastian Huber <sebastian.huber@…>, on 06/14/16 at 09:45:22

posix: _POSIX_Mutex_Default_attributes

Make _POSIX_Mutex_Default_attributes constant and independent of the
scheduler instance. Use INT_MAX to indicate the default ceiling
priority.

  • Property mode set to 100644
File size: 991 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Returns the Appropriate Maximum for Scheduling policy
5 * @ingroup POSIXAPI
6 */
7
8/*
9 *  13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
10 *
11 *  COPYRIGHT (c) 1989-2007.
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 <sched.h>
24
25#include <rtems/seterr.h>
26#include <rtems/posix/priorityimpl.h>
27#include <rtems/score/schedulerimpl.h>
28
29int sched_get_priority_max(
30  int  policy
31)
32{
33  const Scheduler_Control *scheduler;
34
35  switch ( policy ) {
36    case SCHED_OTHER:
37    case SCHED_FIFO:
38    case SCHED_RR:
39    case SCHED_SPORADIC:
40      break;
41
42    default:
43      rtems_set_errno_and_return_minus_one( EINVAL );
44  }
45
46  scheduler = _Scheduler_Get_own( _Thread_Get_executing() );
47  return _POSIX_Priority_Get_maximum( scheduler );
48}
Note: See TracBrowser for help on using the repository browser.