Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/tools/include/nolibc/sched.h
26288 views
1
/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2
/*
3
* sched function definitions for NOLIBC
4
* Copyright (C) 2025 Thomas Weißschuh <[email protected]>
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))
22
int sys_setns(int fd, int nstype)
23
{
24
return my_syscall2(__NR_setns, fd, nstype);
25
}
26
27
static __attribute__((unused))
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))
39
int sys_unshare(int flags)
40
{
41
return my_syscall1(__NR_unshare, flags);
42
}
43
44
static __attribute__((unused))
45
int unshare(int flags)
46
{
47
return __sysret(sys_unshare(flags));
48
}
49
50
#endif /* _NOLIBC_SCHED_H */
51
52