]> granicus.if.org Git - strace/commitdiff
clone: use separate xlat for nstype parameter of setns syscall
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 18 Oct 2016 18:17:33 +0000 (21:17 +0300)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 28 Oct 2016 23:54:01 +0000 (02:54 +0300)
nstype is not flag set but specific type value against which it is
compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)).

* xlat/setns_types.in: New file.
* clone.c: Use printxval and setns_types for nstype parameter.

clone.c
xlat/setns_types.in [new file with mode: 0644]

diff --git a/clone.c b/clone.c
index 604a695eaea10476fa2dd02da1ab62dad71dde97..0dd4fc95c07311c7db82e30f02901b5287870199 100644 (file)
--- a/clone.c
+++ b/clone.c
@@ -38,6 +38,7 @@
 #endif
 
 #include "xlat/clone_flags.h"
+#include "xlat/setns_types.h"
 
 #if defined IA64
 # define ARG_FLAGS     0
@@ -144,7 +145,7 @@ SYS_FUNC(setns)
 {
        printfd(tcp, tcp->u_arg[0]);
        tprints(", ");
-       printflags(clone_flags, tcp->u_arg[1], "CLONE_???");
+       printxval(setns_types, tcp->u_arg[1], "CLONE_NEW???");
 
        return RVAL_DECODED;
 }
diff --git a/xlat/setns_types.in b/xlat/setns_types.in
new file mode 100644 (file)
index 0000000..09186f2
--- /dev/null
@@ -0,0 +1,8 @@
+0
+CLONE_NEWNS    0x00020000
+CLONE_NEWCGROUP        0x02000000
+CLONE_NEWUTS   0x04000000
+CLONE_NEWIPC   0x08000000
+CLONE_NEWUSER  0x10000000
+CLONE_NEWPID   0x20000000
+CLONE_NEWNET   0x40000000