libroot_debug: Merge guarded heap into libroot_debug.
[haiku.git] / src / system / libroot / posix / scheduler.cpp
bloba77f82a3eda01767e87162449e0712cf715453b5
1 /*
2 * Copyright 2009, Michael Franz
3 * Copyright 2008, Andreas Färber, andreas.faerber@web.de
4 * Distributed under the terms of the MIT license.
5 */
8 #include <errno.h>
9 #include <sched.h>
11 #include <OS.h>
13 #include <errno_private.h>
14 #include <syscalls.h>
17 int
18 sched_yield(void)
20 _kern_thread_yield();
21 return 0;
25 int
26 sched_get_priority_min(int policy)
28 switch (policy) {
29 case SCHED_RR:
30 return B_FIRST_REAL_TIME_PRIORITY;
32 case SCHED_OTHER:
33 return B_LOW_PRIORITY;
35 default:
36 __set_errno(EINVAL);
37 return -1;
42 int
43 sched_get_priority_max(int policy)
45 switch (policy) {
46 case SCHED_RR:
47 return B_REAL_TIME_PRIORITY;
49 case SCHED_OTHER:
50 return B_URGENT_DISPLAY_PRIORITY;
52 default:
53 __set_errno(EINVAL);
54 return -1;