Re: [PATCH 0/5 RFC] Add an interface to discover relationships between namespaces

From
Andrew Vagin <hidden>
Date
2016-07-27 04:45:40
Also in
linux-fsdevel, lkml
Reply to
W. Trevor King, 2016-07-26
On Tue, Jul 26, 2016 at 11:32:25AM -0700, W. Trevor King wrote:
On Tue, Jul 26, 2016 at 11:25:24AM -0700, Andrew Vagin wrote:
quoted
Sure. If a process wants to compare two namespaces, it needs to get file
descriptors for them (open /proc/PID/ns/XXX, use new ioctl-s, find a
process which has them),
and then it calls kcmp(pid1, pid2, KCMP_NSFD, ns_fd1, ns_fd2)
If you use the new ioctl-s to get ns_fd2, do you walk your local /proc
to find pid2?
If you use the new ioctl-s to get nf_fd2, you will have it in the
current process, so pid2 will be getpid().

pidX identifies a process where to find fdX.

man 2 kcmp:
 The kcmp() system call can be used to check whether the  two processes
 identified  by  pid1  and  pid2 share a kernel resource such as virtual
 memory, file descriptors, and so on.
Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
Thread (9 messages) 9 messages, 4 authors, last reply 2016-07-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help