Debian Codegraph @

share/libc/sched.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef __FC_SCHED
24 #define __FC_SCHED
25 #include "features.h"
26 __PUSH_FC_STDLIB
27
28 #include "__fc_define_timespec.h"
29 #include "__fc_define_pid_t.h"
30
31 __BEGIN_DECLS
32
33 struct sched_param {
34 int sched_priority;
35 };
36
37 #define SCHED_OTHER 0
38 #define SCHED_FIFO 1
39 #define SCHED_RR 2
40 #define SCHED_SPORADIC 6
41
42 extern int sched_get_priority_max(int);
43 extern int sched_get_priority_min(int);
44 extern int sched_getparam(pid_t, struct sched_param *);
45 extern int sched_getscheduler(pid_t);
46 extern int sched_rr_get_interval(pid_t, struct timespec *);
47 extern int sched_setparam(pid_t, const struct sched_param *);
48 extern int sched_setscheduler(pid_t, int, const struct sched_param *);
49 extern int sched_yield(void);
50
51 __END_DECLS
52 __POP_FC_STDLIB
53 #endif