$ \fBunshare \-Uu sleep 1000 &\fP
[1] 23235
$ \fB./ns_introspect /proc/23235/ns/uts\fP
-Inode number of owning user namespace is: 4026532448
+Device/Inode of owning user namespace is: [0,3] / 4026532448
$ \fBreadlink /proc/23235/ns/user \fP
user:[4026532448]
.in
$ \fBreadlink /proc/self/ns/user\fP
user:[4026531837]
$ \fB./ns_introspect /proc/23235/ns/user\fP
-Inode number of owning user namespace is: 4026531837
+Device/Inode of owning user namespace is: [0,3] / 4026531837
.in
.fi
.nf
/* ns_introspect.c
- Licensed under GNU General Public License v2 or later
+ Licensed under the GNU General Public License v2 or later.
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
-#include <sys/stat.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <string.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
#include <errno.h>
+#include <sys/sysmacros.h>
#ifndef NS_GET_USERNS
#define NSIO 0xb7
perror("fstat\-userns");
exit(EXIT_FAILURE);
}
- printf("Inode number of owning user namespace is: %ld\\n",
+ printf("Device/Inode of owning user namespace is: "
+ "[%lx,%lx] / %ld\\n",
+ (long) major(sb.st_dev), (long) minor(sb.st_dev),
(long) sb.st_ino);
close(userns_fd);
perror("fstat\-parentns");
exit(EXIT_FAILURE);
}
- printf("Inode number of parent namespace is: %ld\\n",
+ printf("Device/Inode of parent namespace is: [%lx,%lx] / %ld\\n",
+ (long) major(sb.st_dev), (long) minor(sb.st_dev),
(long) sb.st_ino);
close(parent_fd);