Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题是该/var/run/netns/目录包含所有网络名称空间,除了 根名称空间。所以我不确定如何获取fd应该传递给以下内核调用的 , :
/var/run/netns/
fd
syscall(__NR_setns, fd, CLONE_NEWNET)
AFAIU,您可以使用/proc/<pid>/ns/net.
/proc/<pid>/ns/net