From a897c1c7d940bd37ae93bd545de03b6471e876fa Mon Sep 17 00:00:00 2001 From: Gaetan Perrot Date: Wed, 31 Jan 2024 22:42:10 +0900 Subject: [PATCH] posix: sched: Implement sched_rr_get_interval Implement `sched_rr_get_interval()` POSIX APIs as a part of PSE53 `_POSIX_PRIORITY_SCHEDULING` option group. Functions is actually placeholders and just return `ENOSYS` since Zephyr does not yet support processes or process scheduling. signed-off-by: Gaetan Perrot --- include/zephyr/posix/sched.h | 3 +++ lib/posix/options/sched.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/posix/sched.h b/include/zephyr/posix/sched.h index 03b568fadea..b337cc2c022 100644 --- a/include/zephyr/posix/sched.h +++ b/include/zephyr/posix/sched.h @@ -10,6 +10,8 @@ #include "posix_types.h" +#include + #ifdef __cplusplus extern "C" { #endif @@ -53,6 +55,7 @@ int sched_getscheduler(pid_t pid); int sched_setparam(pid_t pid, const struct sched_param *param); int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param); +int sched_rr_get_interval(pid_t pid, struct timespec *interval); #ifdef __cplusplus } diff --git a/lib/posix/options/sched.c b/lib/posix/options/sched.c index 195c5895752..be174d92cd6 100644 --- a/lib/posix/options/sched.c +++ b/lib/posix/options/sched.c @@ -101,3 +101,13 @@ int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) return -1; } + +int sched_rr_get_interval(pid_t pid, struct timespec *interval) +{ + ARG_UNUSED(pid); + ARG_UNUSED(interval); + + errno = ENOSYS; + + return -1; +}