How to get file descriptor of parent mount namespace?

112 views Asked by At

In this page: https://man7.org/linux/man-pages/man2/ioctl_ns.2.html

Its mentioned how one can get the file descriptor that refers to the parent namespace of the namespace referred to by fd. Its mentioned that it only works for hierarchical namespaces, i.e., user namespace and pid namespace.

However, reading the man page of mount namespaces (https://man7.org/linux/man-pages/man7/mount_namespaces.7.html), its mentioned that mount namespaces also have a parent and child relationship. This parent-child relationship is important for things like shared-subtrees.

So my question is, is mount namespace not also a hierarchical namespace? I think the answer should be yes, if so, how do I get fd of the parent mount namespace similar to how in the first link shared above the code provides fd of parent pid/user namespace?

0

There are 0 answers