int dump_ipc_ns(int ns_pid, int ns_id) { int ret; struct cr_fdset *fdset; fdset = cr_fdset_open(ns_id, IPCNS, O_DUMP); if (fdset == NULL) return -1; ret = switch_ns(ns_pid, &ipc_ns_desc, NULL); if (ret < 0) goto err; ret = dump_ipc_data(fdset); if (ret < 0) { pr_err("Failed to write IPC namespace data\n"); goto err; } err: close_cr_fdset(&fdset); return ret < 0 ? -1 : 0; }
struct cr_fdset *cr_glob_fdset_open(int mode) { return cr_fdset_open(-1 /* ignored */, GLOB, mode); }
struct cr_fdset *cr_task_fdset_open(int pid, int mode) { return cr_fdset_open(pid, TASK, mode); }
struct cr_fdset *cr_glob_fdset_open(int mode) { return cr_fdset_open(-1 /* ignored */, _CR_FD_GLOB_FROM, _CR_FD_GLOB_TO, mode); }
struct cr_fdset *cr_ns_fdset_open(int pid, int mode) { return cr_fdset_open(pid, _CR_FD_NS_FROM, _CR_FD_NS_TO, mode); }
struct cr_fdset *cr_task_fdset_open(int pid, int mode) { return cr_fdset_open(pid, _CR_FD_TASK_FROM, _CR_FD_TASK_TO, mode); }