posix: sched: Implement set APIs for scheduling parameters

Implement `sched_setparam()` and `sched_setscheduler()` POSIX APIs
as a part of PSE53 `_POSIX_PRIORITY_SCHEDULING` option group.
Both functions are actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
This commit is contained in:
Gaetan Perrot 2024-01-29 14:23:24 +09:00 committed by Carles Cufí
commit 8a6c745e9f
2 changed files with 34 additions and 0 deletions

View file

@ -51,6 +51,9 @@ int sched_get_priority_max(int policy);
int sched_getparam(pid_t pid, struct sched_param *param);
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);
#ifdef __cplusplus
}
#endif

View file

@ -70,3 +70,34 @@ int sched_getscheduler(pid_t pid)
return -1;
}
/**
* @brief Set scheduling parameters
*
* See IEEE 1003.1
*/
int sched_setparam(pid_t pid, const struct sched_param *param)
{
ARG_UNUSED(pid);
ARG_UNUSED(param);
errno = ENOSYS;
return -1;
}
/**
* @brief Set scheduling policy
*
* See IEEE 1003.1
*/
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param)
{
ARG_UNUSED(pid);
ARG_UNUSED(policy);
ARG_UNUSED(param);
errno = ENOSYS;
return -1;
}