summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/sched.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-12-20 01:30:18 -0800
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-21 18:16:48 -0800
commit0f53e0aaeab0c1c5fe1d19c285b08a0c692f31f1 (patch)
treea727e7494b17b0caca2657a03e930d688530e3a1 /Userland/Libraries/LibC/sched.cpp
parent6db9b6cf792f8967b3ae7867b36db60d077a37ed (diff)
downloadserenity-0f53e0aaeab0c1c5fe1d19c285b08a0c692f31f1.zip
LibC: Add POSIX spec comments for sched APIs
Diffstat (limited to 'Userland/Libraries/LibC/sched.cpp')
-rw-r--r--Userland/Libraries/LibC/sched.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/sched.cpp b/Userland/Libraries/LibC/sched.cpp
index 8f08b3cca9..574d85d7eb 100644
--- a/Userland/Libraries/LibC/sched.cpp
+++ b/Userland/Libraries/LibC/sched.cpp
@@ -10,28 +10,33 @@
extern "C" {
+// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html
int sched_yield()
{
int rc = syscall(SC_yield);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
+// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_get_priority_min.html
int sched_get_priority_min([[maybe_unused]] int policy)
{
return 0; // Idle
}
+// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_get_priority_max.html
int sched_get_priority_max([[maybe_unused]] int policy)
{
return 3; // High
}
+// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_setparam.html
int sched_setparam(pid_t pid, const struct sched_param* param)
{
int rc = syscall(SC_sched_setparam, pid, param);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
+// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_getparam.html
int sched_getparam(pid_t pid, struct sched_param* param)
{
int rc = syscall(SC_sched_getparam, pid, param);