Commit 8a6c745e authored by Gaetan Perrot's avatar Gaetan Perrot Committed by Carles Cufi
Browse files

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: default avatarGaetan Perrot <gaetanperrotpro@gmail.com>
parent e08a77c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
+31 −0
Original line number Diff line number Diff line
@@ -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;
}