xref: /freebsd/include/sched.h (revision 33ccf366718d189f206f1ed6c43cbcb7b50a2e6c)
1160b4b92SKonstantin Belousov /*-
2160b4b92SKonstantin Belousov  * Copyright (c) 2021 The FreeBSD Foundation
3160b4b92SKonstantin Belousov  *
4160b4b92SKonstantin Belousov  * This software were developed by Konstantin Belousov <kib@FreeBSD.org>
5160b4b92SKonstantin Belousov  * under sponsorship from the FreeBSD Foundation.
6160b4b92SKonstantin Belousov  *
7160b4b92SKonstantin Belousov  * Redistribution and use in source and binary forms, with or without
8160b4b92SKonstantin Belousov  * modification, are permitted provided that the following conditions
9160b4b92SKonstantin Belousov  * are met:
10160b4b92SKonstantin Belousov  * 1. Redistributions of source code must retain the above copyright
11160b4b92SKonstantin Belousov  *    notice, this list of conditions and the following disclaimer.
12160b4b92SKonstantin Belousov  * 2. Redistributions in binary form must reproduce the above copyright
13160b4b92SKonstantin Belousov  *    notice, this list of conditions and the following disclaimer in the
14160b4b92SKonstantin Belousov  *    documentation and/or other materials provided with the distribution.
15160b4b92SKonstantin Belousov  *
16160b4b92SKonstantin Belousov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17160b4b92SKonstantin Belousov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18160b4b92SKonstantin Belousov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19160b4b92SKonstantin Belousov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20160b4b92SKonstantin Belousov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21160b4b92SKonstantin Belousov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22160b4b92SKonstantin Belousov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23160b4b92SKonstantin Belousov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24160b4b92SKonstantin Belousov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25160b4b92SKonstantin Belousov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26160b4b92SKonstantin Belousov  * SUCH DAMAGE.
27160b4b92SKonstantin Belousov  */
28160b4b92SKonstantin Belousov 
29160b4b92SKonstantin Belousov #ifndef __SCHED_H__
30160b4b92SKonstantin Belousov #define __SCHED_H__
31160b4b92SKonstantin Belousov 
32160b4b92SKonstantin Belousov #include <sys/types.h>
33160b4b92SKonstantin Belousov #include <sys/sched.h>
34160b4b92SKonstantin Belousov #if __BSD_VISIBLE
3590fa9705SKonstantin Belousov #include <sys/cpuset.h>
36160b4b92SKonstantin Belousov struct _cpuset;
37160b4b92SKonstantin Belousov typedef struct _cpuset cpu_set_t;
38160b4b92SKonstantin Belousov #endif /* __BSD_VISIBLE */
39160b4b92SKonstantin Belousov 
4043736b71SKonstantin Belousov __BEGIN_DECLS
4143736b71SKonstantin Belousov #if __BSD_VISIBLE
4243736b71SKonstantin Belousov int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset);
43*65dd3210SDavid CARLIER int sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset);
4477b2c2f8SKonstantin Belousov int sched_getcpu(void);
4543736b71SKonstantin Belousov #endif /* __BSD_VISIBLE */
4643736b71SKonstantin Belousov __END_DECLS
4743736b71SKonstantin Belousov 
48160b4b92SKonstantin Belousov #endif	/* __SCHED_H__ */
49