]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/unshare.2
Ready for 5.00
[thirdparty/man-pages.git] / man2 / unshare.2
index 8adaaffb2b56684ea1fb233dc3c2be55e109bfa8..de7d0a4a98606df5a8851ad31d52e5efb8b9a0c9 100644 (file)
@@ -17,7 +17,7 @@
 .\" by clone, which would require porting and maintaining all commands
 .\" such as login, and su, that establish a user session.
 .\"
-.TH UNSHARE 2 2017-09-15 "Linux" "Linux Programmer's Manual"
+.TH UNSHARE 2 2019-03-06 "Linux" "Linux Programmer's Manual"
 .SH NAME
 unshare \- disassociate parts of the process execution context
 .SH SYNOPSIS
@@ -288,6 +288,58 @@ was specified in
 .IR flags ,
 and the caller is multithreaded.
 .TP
+.B EINVAL
+.BR CLONE_NEWIPC
+was specified in
+.IR flags ,
+but the kernel was not configured with the
+.B CONFIG_SYSVIPC
+and
+.BR CONFIG_IPC_NS
+options.
+.TP
+.B EINVAL
+.BR CLONE_NEWNET
+was specified in
+.IR flags ,
+but the kernel was not configured with the
+.B CONFIG_NET_NS
+option.
+.TP
+.B EINVAL
+.BR CLONE_NEWPID
+was specified in
+.IR flags ,
+but the kernel was not configured with the
+.B CONFIG_PID_NS
+option.
+.TP
+.B EINVAL
+.BR CLONE_NEWUSER
+was specified in
+.IR flags ,
+but the kernel was not configured with the
+.B CONFIG_USER_NS
+option.
+.TP
+.B EINVAL
+.BR CLONE_NEWUTS
+was specified in
+.IR flags ,
+but the kernel was not configured with the
+.B CONFIG_UTS_NS
+option.
+.TP
+.B EINVAL
+.BR CLONE_NEWPID
+was specified in
+.IR flags ,
+but the process has previously called
+.BR unshare ()
+with the
+.BR CLONE_NEWPID
+flag.
+.TP
 .B ENOMEM
 Cannot allocate sufficient memory to copy parts of caller's
 context that need to be unshared.
@@ -408,7 +460,6 @@ new shell are in separate mount namespaces:
 $ \fBreadlink /proc/$$/ns/mnt\fP
 mnt:[4026531840]
 $ \fBsudo ./unshare -m /bin/bash\fP
-[sudo] password for cecilia:
 # \fBreadlink /proc/$$/ns/mnt\fP
 mnt:[4026532325]
 .EE
@@ -434,20 +485,20 @@ commands shows that the two shells are in different mount namespaces.
 /* A simple error\-handling function: print an error message based
    on the value in \(aqerrno\(aq and terminate the calling process */
 
-#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\
+#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \e
                         } while (0)
 
 static void
 usage(char *pname)
 {
-    fprintf(stderr, "Usage: %s [options] program [arg...]\\n", pname);
-    fprintf(stderr, "Options can be:\\n");
-    fprintf(stderr, "    \-i   unshare IPC namespace\\n");
-    fprintf(stderr, "    \-m   unshare mount namespace\\n");
-    fprintf(stderr, "    \-n   unshare network namespace\\n");
-    fprintf(stderr, "    \-p   unshare PID namespace\\n");
-    fprintf(stderr, "    \-u   unshare UTS namespace\\n");
-    fprintf(stderr, "    \-U   unshare user namespace\\n");
+    fprintf(stderr, "Usage: %s [options] program [arg...]\en", pname);
+    fprintf(stderr, "Options can be:\en");
+    fprintf(stderr, "    \-i   unshare IPC namespace\en");
+    fprintf(stderr, "    \-m   unshare mount namespace\en");
+    fprintf(stderr, "    \-n   unshare network namespace\en");
+    fprintf(stderr, "    \-p   unshare PID namespace\en");
+    fprintf(stderr, "    \-u   unshare UTS namespace\en");
+    fprintf(stderr, "    \-U   unshare user namespace\en");
     exit(EXIT_FAILURE);
 }