source: rtems/testsuites/psxtests/psxhdrs/sched03.c @ 66c9ad8

4.104.115
Last change on this file since 66c9ad8 was 66c9ad8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/03/10 at 06:07:24

Reflect POSIX changes to sched_param.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  This test file is used to verify that the header files associated with
3 *  invoking this function are correct.
4 *
5 *  COPYRIGHT (c) 1989-2009.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#include <sched.h>
16
17#ifndef _POSIX_PRIORITY_SCHEDULING
18#error "rtems is supposed to have sched_setscheduler"
19#endif
20
21void test( void );
22
23void test( void )
24{
25  pid_t  pid;
26  int    policy;
27  struct sched_param param;
28  int    result;
29
30  pid = 0;
31
32  policy = SCHED_RR;
33  policy = SCHED_FIFO;
34  policy = SCHED_OTHER;
35#ifdef _POSIX_SPORADIC_SERVER
36  policy = SCHED_SPORADIC;
37#endif
38
39  /*
40   *  really should use sched_get_priority_min() and sched_get_priority_max()
41   */
42
43  param.sched_priority = 0;
44#ifdef _POSIX_SPORADIC_SERVER
45  param.sched_ss_low_priority = 0;
46  param.sched_ss_repl_period.tv_sec = 0;
47  param.sched_ss_repl_period.tv_nsec = 0;
48  param.sched_ss_init_budget.tv_sec = 0;
49  param.sched_ss_init_budget.tv_nsec = 0;
50#endif
51
52  result = sched_setscheduler( pid, policy, &param );
53}
Note: See TracBrowser for help on using the repository browser.