return 0;
}
-static ino_t get_mnt_ino(pid_t pid)
-{
- struct stat st;
- char path[PATH_MAX];
-
- snprintf(path, sizeof(path), "/proc/%u/ns/mnt", (unsigned) pid);
-
- if (stat(path, &st) != 0)
- err(EXIT_FAILURE, _("stat of %s failed"), path);
- return st.st_ino;
-}
-
static void settime(int64_t offset, clockid_t clk_id)
{
char buf[sizeof(stringify_value(ULONG_MAX)) * 3];
static pid_t bind_ns_files_from_child(int *fd)
{
pid_t child, ppid = getpid();
- ino_t ino = get_mnt_ino(ppid);
child = fork_and_wait(fd);
if (child)
return child;
- if (get_mnt_ino(ppid) == ino)
- exit(EXIT_FAILURE);
bind_ns_files(ppid);
exit(EXIT_SUCCESS);
}