aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2018-04-27 14:10:32 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2018-04-27 14:10:32 +0200
commit075f5e65922504d9c9ec48d30b15c3602c3465a6 (patch)
tree17bf33f322d26fb1f19e75bf1ec5b29349bca2de
parent8e13d566514bf01a3abeff11c58bb563f4396378 (diff)
downloadman-pages-075f5e65922504d9c9ec48d30b15c3602c3465a6.tar.gz
namespaces.7: Mention that device ID should also be checked when comparing NS symlinks
When comparing two namespaces symlinks to see if they refer to the same namespace, both the inode number and the device ID should be compared. This point was already made clear in ioctl_ns(2), but was missing from this page. Reported-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man7/namespaces.77
1 files changed, 5 insertions, 2 deletions
diff --git a/man7/namespaces.7 b/man7/namespaces.7
index 725ebaff6a..3c155de7ec 100644
--- a/man7/namespaces.7
+++ b/man7/namespaces.7
@@ -154,11 +154,14 @@ In Linux 3.7 and earlier, these files were visible as hard links.
Since Linux 3.8,
.\" commit bf056bfa80596a5d14b26b17276a56a0dcb080e5
they appear as symbolic links.
-If two processes are in the same namespace, then the inode numbers of their
+If two processes are in the same namespace,
+then the device IDs and inode numbers of their
.IR /proc/[pid]/ns/xxx
symbolic links will be the same; an application can check this using the
+.I stat.st_dev
+and
.I stat.st_ino
-field returned by
+fields returned by
.BR stat (2).
The content of this symbolic link is a string containing
the namespace type and inode number as in the following example: