diff --git a/book/src/kernel/linux-compatibility/README.md b/book/src/kernel/linux-compatibility/README.md index 0087f29c9..696ddd2f1 100644 --- a/book/src/kernel/linux-compatibility/README.md +++ b/book/src/kernel/linux-compatibility/README.md @@ -160,14 +160,14 @@ which are summarized in the table below. | 137 | statfs | ✅ | 💯 | | 138 | fstatfs | ✅ | 💯 | | 139 | sysfs | ❌ | N/A | -| 140 | getpriority | ✅ | ❓ | -| 141 | setpriority | ✅ | ❓ | -| 142 | sched_setparam | ✅ | ❓ | -| 143 | sched_getparam | ✅ | ❓ | -| 144 | sched_setscheduler | ✅ | ❓ | -| 145 | sched_getscheduler | ✅ | ❓ | -| 146 | sched_get_priority_max | ✅ | ❓ | -| 147 | sched_get_priority_min | ✅ | ❓ | +| 140 | getpriority | ✅ | 💯 | +| 141 | setpriority | ✅ | 💯 | +| 142 | sched_setparam | ✅ | 💯 | +| 143 | sched_getparam | ✅ | 💯 | +| 144 | sched_setscheduler | ✅ | [⚠️](syscall-flag-coverage/process-and-thread-management/#sched_setscheduler) | +| 145 | sched_getscheduler | ✅ | 💯 | +| 146 | sched_get_priority_max | ✅ | 💯 | +| 147 | sched_get_priority_min | ✅ | 💯 | | 148 | sched_rr_get_interval | ❌ | N/A | | 149 | mlock | ❌ | N/A | | 150 | munlock | ❌ | N/A | diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/README.md b/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/README.md index 02559ad72..95d76f07c 100644 --- a/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/README.md +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/README.md @@ -52,3 +52,17 @@ Supported functionality in SCML: For more information, see [the man page](https://man7.org/linux/man-pages/man2/clone.2.html). + +### `sched_setscheduler` + +Supported functionality in SCML: + +```c +{{#include sched_setscheduler.scml}} +``` + +Unsupported policies or flags: +* `SCHED_RESET_ON_FORK` + +For more information, +see [the man page](https://man7.org/linux/man-pages/man2/sched_setscheduler.2.html). diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/fully_covered.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/fully_covered.scml index fa6dfcbb4..2f812a8ea 100644 --- a/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/fully_covered.scml +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/fully_covered.scml @@ -79,3 +79,21 @@ setfsgid(fsgid); // Determine CPU and NUMA node on which the calling thread is running getcpu(cpu, node); + +// Get/set program scheduling priority +getpriority(which = PRIO_PROCESS | PRIO_PGRP | PRIO_USER, who); +setpriority(which = PRIO_PROCESS | PRIO_PGRP | PRIO_USER, who, prio); + +sched_policies = SCHED_FIFO | SCHED_RR | SCHED_OTHER | SCHED_BATCH | + SCHED_IDLE | SCHED_DEADLINE; + +// Get static priority range +sched_get_priority_max(policy = ); +sched_get_priority_min(policy = ); + +// Get/set scheduling parameters +sched_setparam(pid, param); +sched_getparam(pid, param); + +// Get scheduling policy +sched_getscheduler(pid); diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/sched_setscheduler.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/sched_setscheduler.scml new file mode 100644 index 000000000..19512fe87 --- /dev/null +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/process-and-thread-management/sched_setscheduler.scml @@ -0,0 +1,2 @@ +// Set scheduling policy +sched_setscheduler(pid, policy = SCHED_OTHER | SCHED_BATCH | SCHED_IDLE | SCHED_FIFO | SCHED_RR, param);