Hi Eric,I'm still wanting your input on the edited setns.2 draft below. Pleasedon't make me chase you round Prague ;-).Cheers,MichaelFrom: Michael Kerrisk <mtk.manpages@gmail.com>Date: Thu, Sep 15, 2011 at 6:13 AMSubject: Re: [PATCH 1/2] setns.2: Initial man pageTo: > +.\"> +.TH SETNS 2 2011-05-28 "Linux" "Linux Programmer's Manual"> +.SH NAME> +setns \- reassociate parts of the process execution context> +.SH SYNOPSIS> +.nf> +.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"> +.B #include <sched.h>> +.sp> +.BI "int setns(int " fd ", int " nstype );> +.fi> +.SH DESCRIPTION> +Given a file descriptor referring to a namespace reassociate the> +current process with that namespace.> +> +The> +.I nstype> +argument is an enumeration that specifies which type of namespace> +the current process may be reassociated with. This argument can> +have one of the following values:> +> +.TP> +.BR 0> +Allow any namespace to be joined.> +.TP> +.BR CLONE_NEWIPC> +Only allow joining an ipc namespace.> +.TP> +.BR CLONE_NEWNET> +Only allow joining a network namespace.> +.TP> +.BR CLONE_NEWUTS> +Only allow joining a uts namespace.> +.PP> +If> +.I flags> +is specified as zero, then> +.BR setns ()> +is a no-op;> +no changes are made to the calling process's execution context.> +.SH RETURN VALUE> +On success, zero returned.> +On failure, \-1 is returned and> +.I errno> +is set to indicate the error.> +.SH ERRORS> +.TP> +.TP> +.B EBADF> +A bad file descriptor was passed to setns.> +> +.TP> +.B EINVAL> +A file descriptor that does not match the specified nstype.> +> +Attempting to change the mount namespace and the filesystem> +is shared between multiple tasks.> +> +.TP> +.B ENOMEM> +Cannot allocate sufficient memory to change the specified namespace.> +> +.TP> +.B EPERM> +The calling process did not have the required privileges for this operation.> +.SH VERSIONS> +The> +.BR setns ()> +system call first appeared in Linux in kernel 3.0> +.SH CONFORMING TO> +The> +.BR setns ()> +system call is Linux-specific.> +.SH NOTES> +Not all of the process attributes that can be shared when> +a new process is created using> +.BR clone (2)> +can be changed using> +.BR setns ().> +.SH BUGS> +The pid namespace and the mount namespace are not currently supported.> +.SH SEE ALSO> +.BR clone (2),> +.BR fork (2),> +.BR vfork (2),> +.BR setns(2)> --> 1.7.5.1.217.g4e3aaI made various edits to the page, some after out F2F conversations.Could you please comment on the new version below?Note: we talked a couple of times about this piece of text under theEINVAL error. Attempted to change the mount namespace, but the filesystem is shared between multiple tasks.As I understand it, this refers to interactions between the mountnamespace and file system namespace. However, as noted in the manpage, setns() does not support CLONE_NEWNS. Furthermore, I can see nopath in the setns() that generates EINVAL and involves CLONE_NEWNS.So,I removed that text. Please let me know if that's wrong.Cheers,Michael.\" Copyright (C) 2011, Eric Biederman <ebiederm@xmission.com>.\" Licensed under the GPLv2.\".TH SETNS 2 2011-09-15 "Linux" "Linux Programmer's Manual".SH NAMEsetns \- reassociate process with a namespace.SH SYNOPSIS.nf.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */".B #include <sched.h>.sp.BI "int setns(int " fd ", int " nstype );.fi.SH DESCRIPTIONGiven a file descriptor referring to a namespace,reassociate the calling process with that namespace.The.I fdargumentargument.The.I nstypeargument specifies which type of namespacethe calling process ..TP.B ENOMEMCannot allocate sufficient memory to change the specified namespace..TP.B EPERMThe calling process process attributes that can be shared whena new process)--To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at read the FAQ at