Lines Matching refs:newns
67 char *newns = NULL; in nsinfo__init() local
78 if (asprintf(&newns, "/proc/%d/ns/mnt", nsi->pid) == -1) in nsinfo__init()
84 if (stat(newns, &new_stat) < 0) in nsinfo__init()
92 nsi->mntns_path = newns; in nsinfo__init()
93 newns = NULL; in nsinfo__init()
126 free(newns); in nsinfo__init()
206 int newns = -1; in nsinfo__mountns_enter() local
213 nc->newns = -1; in nsinfo__mountns_enter()
229 newns = open(nsi->mntns_path, O_RDONLY); in nsinfo__mountns_enter()
230 if (newns < 0) in nsinfo__mountns_enter()
233 if (setns(newns, CLONE_NEWNS) < 0) in nsinfo__mountns_enter()
238 nc->newns = newns; in nsinfo__mountns_enter()
245 if (newns > -1) in nsinfo__mountns_enter()
246 close(newns); in nsinfo__mountns_enter()
251 if (nc == NULL || nc->oldns == -1 || nc->newns == -1 || !nc->oldcwd) in nsinfo__mountns_exit()
266 if (nc->newns > -1) { in nsinfo__mountns_exit()
267 close(nc->newns); in nsinfo__mountns_exit()
268 nc->newns = -1; in nsinfo__mountns_exit()