构建 “真正” 应用世界的系统调用
switch_root 命令背后的系统调用
int pivot_root(const char *new_root, const char *put_old);
pivot_root()
changes the root mount in the mount namespace of the calling process. More precisely, it moves the root mount to the directory put_old
and makes new_root
the new root mount. The calling process must have the CAP_SYS_ADMIN
capability in the user namespace that owns the caller's mount namespace.
- syscalls(2)