posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
sched.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018-2023 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#ifndef ZEPHYR_INCLUDE_POSIX_SCHED_H_
16#define ZEPHYR_INCLUDE_POSIX_SCHED_H_
17
18#include <sys/types.h>
19#include <time.h>
20
21#include <zephyr/kernel.h>
22
23#if defined(_GNU_SOURCE) || defined(__DOXYGEN__)
25#endif
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
37#define SCHED_OTHER 0
38
40#define SCHED_FIFO 1
41
43#define SCHED_RR 2
44
45#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER) || \
46 defined(__DOXYGEN__)
51#define SCHED_SPORADIC 4
52#endif
53
54#if (defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
55 || defined(CONFIG_ARCMWDT_LIBC)) && !defined(_SCHED_PARAM_DEFINED) && \
56 !defined(__sched_param_defined)
58struct sched_param {
59 int sched_priority;
60#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER) || \
61 defined(__DOXYGEN__)
62 struct timespec sched_ss_repl_period;
63 struct timespec sched_ss_init_budget;
64 int sched_ss_low_priority;
65 int sched_ss_max_repl;
66#endif
67};
68#define _SCHED_PARAM_DEFINED
69#define __sched_param_defined
70#endif
71
81int sched_yield(void);
82
90int sched_get_priority_min(int policy);
91
99int sched_get_priority_max(int policy);
100
109int sched_getparam(pid_t pid, struct sched_param *param);
110
120
129int sched_setparam(pid_t pid, const struct sched_param *param);
130
140int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param);
141
150int sched_rr_get_interval(pid_t pid, struct timespec *interval);
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif /* ZEPHYR_INCLUDE_POSIX_SCHED_H_ */
CPU sets for thread affinity (GNU extension, <sched.h>)
int pid_t
Process ID type.
Definition fcntl.h:192
int sched_yield(void)
Yield the processor to another thread of equal or higher priority.
int sched_setparam(pid_t pid, const struct sched_param *param)
Set scheduling parameters for a process.
int sched_rr_get_interval(pid_t pid, struct timespec *interval)
Get the round-robin time quantum for a process.
int sched_getparam(pid_t pid, struct sched_param *param)
Get scheduling parameters for a process.
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param)
Set the scheduling policy and parameters of a process.
int sched_getscheduler(pid_t pid)
Get the scheduling policy of a process.
int sched_get_priority_min(int policy)
Get the minimum priority value for a scheduling policy.
int sched_get_priority_max(int policy)
Get the maximum priority value for a scheduling policy.
Time value with nanosecond resolution.
Definition aio.h:65
POSIX time-of-day types and functions (<sys/time.h>)
POSIX fundamental types (<sys/types.h>)