[PATCH 14/26] clone: Use separate flag list for unshare

Eugene Syromyatnikov evgsyr at gmail.com
Mon Oct 24 03:01:40 UTC 2016


Not all clone flags could be passed to unshare (see check_unshare_flags
function in kernel/fork.c).

* xlat/unshare_flags.in: New file.
* clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags
parameter.
---
 clone.c               |    3 ++-
 xlat/unshare_flags.in |   13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 xlat/unshare_flags.in

diff --git a/clone.c b/clone.c
index 0dd4fc9..c2832c1 100644
--- a/clone.c
+++ b/clone.c
@@ -39,6 +39,7 @@
 
 #include "xlat/clone_flags.h"
 #include "xlat/setns_types.h"
+#include "xlat/unshare_flags.h"
 
 #if defined IA64
 # define ARG_FLAGS	0
@@ -152,7 +153,7 @@ SYS_FUNC(setns)
 
 SYS_FUNC(unshare)
 {
-	printflags_long(clone_flags, tcp->u_arg[0], "CLONE_???");
+	printflags_long(unshare_flags, tcp->u_arg[0], "CLONE_???");
 	return RVAL_DECODED;
 }
 
diff --git a/xlat/unshare_flags.in b/xlat/unshare_flags.in
new file mode 100644
index 0000000..4b289a7
--- /dev/null
+++ b/xlat/unshare_flags.in
@@ -0,0 +1,13 @@
+CLONE_THREAD
+CLONE_FS
+CLONE_NEWNS
+CLONE_SIGHAND
+CLONE_VM
+CLONE_FILES
+CLONE_SYSVSEM
+CLONE_NEWUTS
+CLONE_NEWIPC
+CLONE_NEWNET
+CLONE_NEWUSER
+CLONE_NEWPID
+CLONE_NEWCGROUP
-- 
1.7.10.4





More information about the Strace-devel mailing list