xref: /linux/tools/include/nolibc/sched.h (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /*
3  * sched function definitions for NOLIBC
4  * Copyright (C) 2025 Thomas Weißschuh <linux@weissschuh.net>
5  */
6 
7 /* make sure to include all global symbols */
8 #include "nolibc.h"
9 
10 #ifndef _NOLIBC_SCHED_H
11 #define _NOLIBC_SCHED_H
12 
13 #include "sys.h"
14 
15 #include <linux/sched.h>
16 
17 /*
18  * int setns(int fd, int nstype);
19  */
20 
21 static __attribute__((unused))
sys_setns(int fd,int nstype)22 int sys_setns(int fd, int nstype)
23 {
24 	return my_syscall2(__NR_setns, fd, nstype);
25 }
26 
27 static __attribute__((unused))
setns(int fd,int nstype)28 int setns(int fd, int nstype)
29 {
30 	return __sysret(sys_setns(fd, nstype));
31 }
32 
33 
34 /*
35  * int unshare(int flags);
36  */
37 
38 static __attribute__((unused))
sys_unshare(int flags)39 int sys_unshare(int flags)
40 {
41 	return my_syscall1(__NR_unshare, flags);
42 }
43 
44 static __attribute__((unused))
unshare(int flags)45 int unshare(int flags)
46 {
47 	return __sysret(sys_unshare(flags));
48 }
49 
50 #endif /* _NOLIBC_SCHED_H */
51