api: ifdef out some posix options
[libc-test] / src / api / sched.c
1 #include <sched.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 #ifdef X_PS
8 T(pid_t)
9 #endif
10 T(time_t)
11 T(struct timespec)
12 {
13 struct sched_param x;
14 F(int,sched_priority)
15 F(int,sched_ss_low_priority)
16 F(struct timespec,sched_ss_repl_period)
17 F(struct timespec,sched_ss_init_budget)
18 F(int,sched_ss_max_repl)
19 }
20
21 C(SCHED_SPORADIC)
22 {int(*p)(void) = sched_yield;}
23
24 #if defined(X_PS) || defined(X_TPS)
25 C(SCHED_FIFO)
26 C(SCHED_RR)
27 C(SCHED_OTHER)
28 {int(*p)(int) = sched_get_priority_max;}
29 {int(*p)(int) = sched_get_priority_min;}
30 {int(*p)(pid_t,struct timespec*) = sched_rr_get_interval;}
31 #endif
32
33 #ifdef X_PS
34 {int(*p)(pid_t,struct sched_param*) = sched_getparam;}
35 {int(*p)(pid_t) = sched_getscheduler;}
36 {int(*p)(pid_t,const struct sched_param*) = sched_setparam;}
37 {int(*p)(pid_t,int,const struct sched_param*) = sched_setscheduler;}
38 #endif
39 }