summaryrefslogtreecommitdiff
path: root/components/libc/pthreads/sched.c
blob: a1bf50985eff7a56a273cf100d03d65a91c96679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 */

#include <sched.h>

int sched_yield(void)
{
    rt_thread_yield();

    return 0;
}
RTM_EXPORT(sched_yield);

int sched_get_priority_min(int policy)
{
    if (policy != SCHED_FIFO && policy != SCHED_RR)
        return EINVAL;

    return 0;
}
RTM_EXPORT(sched_get_priority_min);

int sched_get_priority_max(int policy)
{
    if (policy != SCHED_FIFO && policy != SCHED_RR)
        return EINVAL;

    return RT_THREAD_PRIORITY_MAX - 1;
}
RTM_EXPORT(sched_get_priority_max);

int sched_setscheduler(pid_t pid, int policy)
{
    return EOPNOTSUPP;
}
RTM_EXPORT(sched_setscheduler);