Elliott Hughes | 13da600 | 2025-02-03 10:42:13 -0800 | [diff] [blame] | 1 | // Copyright (C) 2017 The Android Open Source Project |
| 2 | // SPDX-License-Identifier: BSD-2-Clause |
Elliott Hughes | 21b56eb | 2017-10-20 17:57:17 -0700 | [diff] [blame] | 3 | |
| 4 | #if !defined(DO_NOT_INCLUDE_SCHED_H) |
| 5 | #include <sched.h> |
| 6 | #endif |
| 7 | |
| 8 | #include "header_checks.h" |
| 9 | |
| 10 | static void sched_h() { |
| 11 | TYPE(pid_t); |
| 12 | TYPE(time_t); |
| 13 | TYPE(struct timespec); |
| 14 | |
| 15 | TYPE(struct sched_param); |
| 16 | STRUCT_MEMBER(struct sched_param, int, sched_priority); |
| 17 | #if !defined(__linux__) |
| 18 | STRUCT_MEMBER(struct sched_param, int, sched_ss_low_priority); |
| 19 | STRUCT_MEMBER(struct sched_param, struct timespec, sched_ss_repl_period); |
| 20 | STRUCT_MEMBER(struct sched_param, struct timespec, sched_ss_init_budget); |
| 21 | STRUCT_MEMBER(struct sched_param, int, sched_ss_max_repl); |
| 22 | #endif |
| 23 | |
| 24 | MACRO(SCHED_FIFO); |
| 25 | MACRO(SCHED_RR); |
| 26 | #if !defined(__linux__) |
| 27 | MACRO(SCHED_SPORADIC); |
| 28 | #endif |
| 29 | MACRO(SCHED_OTHER); |
| 30 | |
| 31 | FUNCTION(sched_get_priority_max, int (*f)(int)); |
| 32 | FUNCTION(sched_get_priority_min, int (*f)(int)); |
| 33 | FUNCTION(sched_getparam, int (*f)(pid_t, struct sched_param*)); |
| 34 | FUNCTION(sched_getscheduler, int (*f)(pid_t)); |
| 35 | FUNCTION(sched_rr_get_interval, int (*f)(pid_t, struct timespec*)); |
| 36 | FUNCTION(sched_setparam, int (*f)(pid_t, const struct sched_param*)); |
| 37 | FUNCTION(sched_setscheduler, int (*f)(pid_t, int, const struct sched_param*)); |
| 38 | FUNCTION(sched_yield, int (*f)(void)); |
| 39 | } |