X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fapi%2Fsched.c;h=def5b354fc40e14ad051bc54d9c3b133dbb64056;hb=088f2d9c1940e9bf1828cc1c899b4c63a41be768;hp=0a130aeef86f6a2fd2a9bd330640466697d6e783;hpb=056b010b1d5296266c0c61891d4ae896f9c9ba65;p=libc-test diff --git a/src/api/sched.c b/src/api/sched.c index 0a130ae..def5b35 100644 --- a/src/api/sched.c +++ b/src/api/sched.c @@ -1,30 +1,35 @@ #include +#include "options.h" #define T(t) (t*)0; #define F(t,n) {t *y = &x.n;} #define C(n) switch(n){case n:;} static void f() { -T(pid_t) -T(time_t) T(struct timespec) { struct sched_param x; F(int,sched_priority) +#if defined(POSIX_SPORADIC_SERVER) || defined(POSIX_THREAD_SPORADIC_SERVER) F(int,sched_ss_low_priority) F(struct timespec,sched_ss_repl_period) F(struct timespec,sched_ss_init_budget) F(int,sched_ss_max_repl) +T(time_t) +C(SCHED_SPORADIC) +#endif } +#ifdef POSIX_PRIORITY_SCHEDULING +T(pid_t) +{int(*p)(pid_t,struct sched_param*) = sched_getparam;} +{int(*p)(pid_t) = sched_getscheduler;} +{int(*p)(pid_t,const struct sched_param*) = sched_setparam;} +{int(*p)(pid_t,int,const struct sched_param*) = sched_setscheduler;} +#endif C(SCHED_FIFO) C(SCHED_RR) -C(SCHED_SPORADIC) C(SCHED_OTHER) -int(*p_sched_get_priority_max)(int) = sched_get_priority_max; -int(*p_sched_get_priority_min)(int) = sched_get_priority_min; -int(*p_sched_getparam)(pid_t,struct sched_param*) = sched_getparam; -int(*p_sched_getscheduler)(pid_t) = sched_getscheduler; -int(*p_sched_rr_get_interval)(pid_t,struct timespec*) = sched_rr_get_interval; -int(*p_sched_setparam)(pid_t,const struct sched_param*) = sched_setparam; -int(*p_sched_setscheduler)(pid_t,int,const struct sched_param*) = sched_setscheduler; -int(*p_sched_yield)(void) = sched_yield; +{int(*p)(int) = sched_get_priority_max;} +{int(*p)(int) = sched_get_priority_min;} +{int(*p)(pid_t,struct timespec*) = sched_rr_get_interval;} +{int(*p)(void) = sched_yield;} }