2010-11-18 07:35:13 +08:00
|
|
|
#include <sched.h>
|
|
|
|
|
|
|
|
int sched_yield(void)
|
|
|
|
{
|
|
|
|
rt_thread_yield();
|
|
|
|
return 0;
|
|
|
|
}
|
2012-11-23 10:40:32 +08:00
|
|
|
RTM_EXPORT(sched_yield);
|
2010-11-18 07:35:13 +08:00
|
|
|
|
|
|
|
int sched_get_priority_min(int policy)
|
|
|
|
{
|
|
|
|
if (policy != SCHED_FIFO && policy != SCHED_RR)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2012-11-23 10:40:32 +08:00
|
|
|
RTM_EXPORT(sched_get_priority_min);
|
2010-11-18 07:35:13 +08:00
|
|
|
|
|
|
|
int sched_get_priority_max(int policy)
|
|
|
|
{
|
|
|
|
if (policy != SCHED_FIFO && policy != SCHED_RR)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
return RT_THREAD_PRIORITY_MAX - 1;
|
|
|
|
}
|
2012-11-23 10:40:32 +08:00
|
|
|
RTM_EXPORT(sched_get_priority_max);
|
2010-11-18 07:35:13 +08:00
|
|
|
|
|
|
|
int sched_setscheduler(pid_t pid, int policy)
|
|
|
|
{
|
|
|
|
return ENOTSUP;
|
|
|
|
}
|
2012-11-23 10:40:32 +08:00
|
|
|
RTM_EXPORT(sched_setscheduler);
|