zephyr/lib/posix/pthread_sched.h
Chris Friedt b9828a74ab posix: sched: add support for SCHED_OTHER
The `SCHED_OTHER` scheduling priority is mandatory as part of
POSIX. It must be numerically distinct from `SCHED_FIFO`,
`SCHED_RR`, and `SCHED_SPORADIC`, but is implementation-
defined and may behave identically to `SCHED_FIFO` or
`SCHED_RR`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-04-29 13:14:40 -07:00

20 lines
368 B
C

/*
* Copyright (c) 2023 Meta
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_LIB_POSIX_POSIX_PTHREAD_SCHED_H_
#define ZEPHYR_LIB_POSIX_POSIX_PTHREAD_SCHED_H_
#include <stdbool.h>
#include <zephyr/posix/sched.h>
static inline bool valid_posix_policy(int policy)
{
return policy == SCHED_FIFO || policy == SCHED_RR || policy == SCHED_OTHER;
}
#endif