Lines Matching defs:pidfd
16 #include "pidfd.h"
23 int pidfd;
39 self->pidfd = sys_pidfd_open(getpid(), 0);
40 ASSERT_GE(self->pidfd, 0);
41 ASSERT_GE(fstat(self->pidfd, &self->st1), 0);
42 ASSERT_EQ(ioctl(self->pidfd, FS_IOC_GETVERSION, &self->gen1), 0);
54 * Test that a detached mount can be created for a pidfd and then
61 fd_tree = sys_open_tree(self->pidfd, "", OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC | AT_EMPTY_PATH);
70 /* Test that a pidfd can be reopened through procfs. */
73 int pidfd;
76 sprintf(proc_path, "/proc/self/fd/%d", self->pidfd);
77 pidfd = open(proc_path, O_RDONLY | O_NOCTTY | O_CLOEXEC);
78 ASSERT_GE(pidfd, 0);
80 ASSERT_GE(fstat(self->pidfd, &self->st2), 0);
81 ASSERT_EQ(ioctl(self->pidfd, FS_IOC_GETVERSION, &self->gen2), 0);
86 ASSERT_EQ(close(pidfd), 0);
90 * Test that a detached mount can be created for a pidfd and then
97 fd_tree = sys_open_tree(self->pidfd, "", OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC | AT_EMPTY_PATH);