diff options
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch')
-rw-r--r-- | meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch new file mode 100644 index 0000000000..94c6f68571 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From db575359d4b8164ad6c2ac5f36c7a50c065a2864 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 20 Feb 2014 00:44:34 -0800 | ||
4 | Subject: [PATCH 2/3] wire setns syscall | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | Upstream-Status: Pending | ||
8 | --- | ||
9 | libc/sysdeps/linux/common/Makefile.in | 1 + | ||
10 | libc/sysdeps/linux/common/bits/sched.h | 4 ++++ | ||
11 | libc/sysdeps/linux/common/setns.c | 18 ++++++++++++++++++ | ||
12 | 3 files changed, 23 insertions(+) | ||
13 | create mode 100644 libc/sysdeps/linux/common/setns.c | ||
14 | |||
15 | diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in | ||
16 | index 45d2e21..10d9884 100644 | ||
17 | --- a/libc/sysdeps/linux/common/Makefile.in | ||
18 | +++ b/libc/sysdeps/linux/common/Makefile.in | ||
19 | @@ -45,6 +45,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ | ||
20 | sendfile.c \ | ||
21 | setfsgid.c \ | ||
22 | setfsuid.c \ | ||
23 | + setns.c \ | ||
24 | setresgid.c \ | ||
25 | setresuid.c \ | ||
26 | signalfd.c \ | ||
27 | diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h | ||
28 | index a5eb6ee..9436f66 100644 | ||
29 | --- a/libc/sysdeps/linux/common/bits/sched.h | ||
30 | +++ b/libc/sysdeps/linux/common/bits/sched.h | ||
31 | @@ -85,6 +85,10 @@ extern int unshare (int __flags) __THROW; | ||
32 | |||
33 | /* Get index of currently used CPU. */ | ||
34 | extern int sched_getcpu (void) __THROW; | ||
35 | + | ||
36 | +/* Switch process to namespace of type NSTYPE indicated by FD. */ | ||
37 | +extern int setns (int __fd, int __nstype) __THROW; | ||
38 | + | ||
39 | #endif | ||
40 | |||
41 | __END_DECLS | ||
42 | diff --git a/libc/sysdeps/linux/common/setns.c b/libc/sysdeps/linux/common/setns.c | ||
43 | new file mode 100644 | ||
44 | index 0000000..376bf26 | ||
45 | --- /dev/null | ||
46 | +++ b/libc/sysdeps/linux/common/setns.c | ||
47 | @@ -0,0 +1,18 @@ | ||
48 | +/* vi: set sw=4 ts=4: */ | ||
49 | +/* | ||
50 | + * setns() for uClibc | ||
51 | + * | ||
52 | + * Copyright (C) 2014 Khem Raj <raj.khem@gmail.com> | ||
53 | + * | ||
54 | + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | ||
55 | + */ | ||
56 | + | ||
57 | +#include <sys/syscall.h> | ||
58 | +#include <sched.h> | ||
59 | + | ||
60 | +/* | ||
61 | + * setns() | ||
62 | + */ | ||
63 | +#ifdef __NR_setns | ||
64 | +_syscall2(int, setns, int, fd, int, nstype) | ||
65 | +#endif | ||
66 | -- | ||
67 | 1.9.0 | ||
68 | |||