-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprint_sched.cpp
32 lines (24 loc) · 1.04 KB
/
print_sched.cpp
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
// Convenience script to print the min and max priority for each valid
// scheduling priority on a Raspberry Pi
#include <iostream>
#include <sched.h>
int main() {
int min;
int max;
min = sched_get_priority_min (SCHED_OTHER);
max = sched_get_priority_max (SCHED_OTHER);
std::cout << "SCHED_OTHER min: " << min << "\tmax: " << max << std::endl;
min = sched_get_priority_min (SCHED_BATCH);
max = sched_get_priority_max (SCHED_BATCH);
std::cout << "SCHED_BATCH min: " << min << "\tmax: " << max << std::endl;
min = sched_get_priority_min (SCHED_IDLE);
max = sched_get_priority_max (SCHED_IDLE);
std::cout << "SCHED_IDLE min: " << min << "\tmax: " << max << std::endl;
min = sched_get_priority_min (SCHED_RR);
max = sched_get_priority_max (SCHED_RR);
std::cout << "SCHED_RR min: " << min << "\tmax: " << max << std::endl;
min = sched_get_priority_min (SCHED_FIFO);
max = sched_get_priority_max (SCHED_FIFO);
std::cout << "SCHED_FIFO min: " << min << "\tmax: " << max << std::endl;
return 0;
}