[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160721210650.GA10989@outlook.office365.com>
Date: Thu, 21 Jul 2016 14:06:50 -0700
From: Andrew Vagin <avagin@...tuozzo.com>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
CC: Andrey Vagin <avagin@...nvz.org>, <linux-kernel@...r.kernel.org>,
<linux-api@...r.kernel.org>,
<containers@...ts.linux-foundation.org>, <criu@...nvz.org>,
<linux-fsdevel@...r.kernel.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
James Bottomley <James.Bottomley@...senPartnership.com>,
"W. Trevor King" <wking@...mily.us>,
Alexander Viro <viro@...iv.linux.org.uk>,
Serge Hallyn <serge.hallyn@...onical.com>
Subject: Re: [PATCH 0/5 RFC] Add an interface to discover relationships
between namespaces
On Thu, Jul 21, 2016 at 04:41:12PM +0200, Michael Kerrisk (man-pages) wrote:
> Hi Andrey,
>
> On 07/14/2016 08:20 PM, Andrey Vagin wrote:
<snip>
>
> Could you add here an of the API in detail: what do these FDs refer to,
> and how do you use them to solve the use case? And could you you add
> that info to the commit messages please.
Hi Michael,
A patch for man-pages is attached. It adds the following text to
namespaces(7).
Since Linux 4.X, the following ioctl(2) calls are supported for names‐
pace file descriptors. The correct syntax is:
fd = ioctl(ns_fd, ioctl_type);
where ioctl_type is one of the following:
NS_GET_USERNS
Returns a file descriptor that refers to an owning user names‐
pace.
NS_GET_PARENT
Returns a file descriptor that refers to a parent namespace.
This ioctl(2) can be used for pid and user namespaces. For user
namespaces, NS_GET_PARENT and NS_GET_USERNS have the same mean‐
ing.
In addition to generic ioctl(2) errors, the following specific ones can
occur:
EINVAL NS_GET_PARENT was called for a nonhierarchical namespace.
EPERM The requested namespace is outside of the current namespace
scope.
ENOENT ns_fd refers to the init namespace.
Thanks,
Andrew
>
> Thanks,
>
> Michael
>
>
> > [1] https://lkml.org/lkml/2016/7/6/158
> > [2] https://lkml.org/lkml/2016/7/9/101
> >
> > Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
> > Cc: James Bottomley <James.Bottomley@...senPartnership.com>
> > Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
> > Cc: "W. Trevor King" <wking@...mily.us>
> > Cc: Alexander Viro <viro@...iv.linux.org.uk>
> > Cc: Serge Hallyn <serge.hallyn@...onical.com>
> >
> > --
> > 2.5.5
> >
> >
>
>
> --
> Michael Kerrisk
> Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
> Linux/UNIX System Programming Training: http://man7.org/training/
View attachment "0001-namespace.7-descirbe-NS_GET_USERNS-and-NS_GET-PARENT.patch" of type "text/plain" (1740 bytes)
Powered by blists - more mailing lists