/linux-6.1.9/tools/testing/selftests/pidfd/ |
D | pidfd_wait.c | 42 int pidfd = -1; in TEST() local 46 .pidfd = ptr_to_u64(&pidfd), in TEST() 55 pidfd = open("/proc/self", O_DIRECTORY | O_RDONLY | O_CLOEXEC); in TEST() 56 ASSERT_GE(pidfd, 0); in TEST() 58 pid = sys_waitid(P_PIDFD, pidfd, &info, WEXITED, NULL); in TEST() 60 EXPECT_EQ(close(pidfd), 0); in TEST() 61 pidfd = -1; in TEST() 63 pidfd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 64 ASSERT_GE(pidfd, 0); in TEST() 66 pid = sys_waitid(P_PIDFD, pidfd, &info, WEXITED, NULL); in TEST() [all …]
|
D | pidfd_test.c | 33 static pid_t pidfd_clone(int flags, int *pidfd, int (*fn)(void *)) in pidfd_clone() argument 39 return __clone2(fn, stack, stack_size, flags | SIGCHLD, NULL, pidfd); in pidfd_clone() 41 return clone(fn, stack + stack_size, flags | SIGCHLD, NULL, pidfd); in pidfd_clone() 59 int pidfd, ret; in test_pidfd_send_signal_simple_success() local 69 pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_simple_success() 70 if (pidfd < 0) in test_pidfd_send_signal_simple_success() 77 ret = sys_pidfd_send_signal(pidfd, SIGUSR1, NULL, 0); in test_pidfd_send_signal_simple_success() 78 close(pidfd); in test_pidfd_send_signal_simple_success() 94 int pidfd, ret, saved_errno; in test_pidfd_send_signal_exited_fail() local 116 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_exited_fail() [all …]
|
D | pidfd_open_test.c | 86 static pid_t get_pid_from_fdinfo_file(int pidfd, const char *key, size_t keylen) in get_pid_from_fdinfo_file() argument 95 snprintf(path, sizeof(path), "/proc/self/fdinfo/%d", pidfd); in get_pid_from_fdinfo_file() 123 int pidfd = -1, ret = 1; in main() local 128 pidfd = sys_pidfd_open(-1, 0); in main() 129 if (pidfd >= 0) { in main() 137 pidfd = sys_pidfd_open(getpid(), 1); in main() 138 if (pidfd >= 0) { in main() 146 pidfd = sys_pidfd_open(getpid(), 0); in main() 147 if (pidfd < 0) { in main() 153 pid = get_pid_from_fdinfo_file(pidfd, "Pid:", sizeof("Pid:") - 1); in main() [all …]
|
D | pidfd_poll_test.c | 48 int pidfd; in main() local 68 pidfd = sys_pidfd_open(child_pid, 0); in main() 69 if (pidfd < 0) in main() 80 if (sys_pidfd_send_signal(pidfd, SIGKILL, NULL, 0)) in main() 85 fds.fd = pidfd; in main() 106 close(pidfd); in main()
|
D | pidfd_getfd_test.c | 126 int pidfd; in FIXTURE() local 155 self->pidfd = sys_pidfd_open(self->pid, 0); in FIXTURE_SETUP() 156 ASSERT_GE(self->pidfd, 0); in FIXTURE_SETUP() 168 EXPECT_EQ(0, close(self->pidfd)); in FIXTURE_TEARDOWN() 192 fd = sys_pidfd_getfd(self->pidfd, self->remote_fd, 0); in TEST_F() 204 fd = sys_pidfd_getfd(self->pidfd, self->remote_fd, 0); in TEST_F() 223 fd = sys_pidfd_getfd(self->pidfd, UNKNOWN_FD, 0); in TEST_F()
|
D | pidfd.h | 102 static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info, in sys_pidfd_send_signal() argument 105 return syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags); in sys_pidfd_send_signal() 108 static inline int sys_pidfd_getfd(int pidfd, int fd, int flags) in sys_pidfd_getfd() argument 110 return syscall(__NR_pidfd_getfd, pidfd, fd, flags); in sys_pidfd_getfd()
|
D | pidfd_fdinfo_test.c | 163 static int verify_fdinfo(int pidfd, struct error *err, const char *prefix, in verify_fdinfo() argument 180 snprintf(path, sizeof(path), "/proc/self/fdinfo/%d", pidfd); in verify_fdinfo() 184 pidfd); in verify_fdinfo() 210 prefix, pidfd); in verify_fdinfo() 218 int pidfd; in child_fdinfo_nspid_test() local 242 pidfd = *(int *)args; in child_fdinfo_nspid_test() 243 r = verify_fdinfo(pidfd, &err, "NSpid:", 6, "\t0\n"); in child_fdinfo_nspid_test()
|
D | pidfd_setns_test.c | 55 int pidfd; in FIXTURE() local 75 pid_t create_child(int *pidfd, unsigned flags) in create_child() argument 80 .pidfd = ptr_to_u64(pidfd), in create_child() 153 self->pidfd = sys_pidfd_open(self->pid, 0); in FIXTURE_SETUP() 154 EXPECT_GT(self->pidfd, 0) { in FIXTURE_SETUP() 168 self->pidfd = sys_pidfd_open(self->pid, 0); in FIXTURE_SETUP() 169 EXPECT_GE(self->pidfd, 0) { in FIXTURE_SETUP() 345 ASSERT_NE(setns(self->pidfd, 0), 0); in TEST_F() 348 ASSERT_NE(setns(self->pidfd, -1), 0); in TEST_F() 351 ASSERT_NE(setns(self->pidfd, CLONE_VM), 0); in TEST_F() [all …]
|
/linux-6.1.9/samples/pidfd/ |
D | pidfd-metadata.c | 34 static pid_t pidfd_clone(int flags, int *pidfd) in pidfd_clone() argument 40 return __clone2(do_child, stack, stack_size, flags | SIGCHLD, NULL, pidfd); in pidfd_clone() 42 return clone(do_child, stack + stack_size, flags | SIGCHLD, NULL, pidfd); in pidfd_clone() 46 static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info, in sys_pidfd_send_signal() argument 49 return syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags); in sys_pidfd_send_signal() 52 static int pidfd_metadata_fd(pid_t pid, int pidfd) in pidfd_metadata_fd() argument 68 ret = sys_pidfd_send_signal(pidfd, 0, NULL, 0); in pidfd_metadata_fd() 86 int pidfd = -1, ret = EXIT_FAILURE; in main() local 92 pid = pidfd_clone(CLONE_PIDFD, &pidfd); in main() 95 if (pidfd == -1) { in main() [all …]
|
D | .gitignore | 2 /pidfd-metadata
|
D | Makefile | 2 usertprogs-always-y += pidfd-metadata
|
/linux-6.1.9/tools/testing/selftests/vm/ |
D | mrelease_test.c | 63 static void run_negative_tests(int pidfd) in run_negative_tests() argument 67 if (!syscall(__NR_process_mrelease, pidfd, (unsigned int)-1) || in run_negative_tests() 77 if (!syscall(__NR_process_mrelease, pidfd, 0) || errno != EINVAL) { in run_negative_tests() 97 int pipefd[2], pidfd; in main() local 151 pidfd = syscall(__NR_pidfd_open, pid, 0); in main() 152 if (pidfd < 0) { in main() 160 run_negative_tests(pidfd); in main() 168 success = (syscall(__NR_process_mrelease, pidfd, 0) == 0); in main() 192 close(pidfd); in main()
|
/linux-6.1.9/tools/testing/selftests/pid_namespace/ |
D | Makefile | 6 LOCAL_HDRS += $(selfdir)/pidfd/pidfd.h
|
/linux-6.1.9/tools/testing/selftests/cgroup/ |
D | Makefile | 16 LOCAL_HDRS += $(selfdir)/clone3/clone3_selftests.h $(selfdir)/pidfd/pidfd.h
|
/linux-6.1.9/arch/sparc/kernel/ |
D | process.c | 80 args.pidfd = compat_ptr(regs->u_regs[UREG_I2]); in sparc_clone() 86 args.pidfd = (int __user *)regs->u_regs[UREG_I2]; in sparc_clone()
|
/linux-6.1.9/fs/notify/fanotify/ |
D | fanotify_user.c | 473 static int copy_pidfd_info_to_user(int pidfd, in copy_pidfd_info_to_user() argument 485 info.pidfd = pidfd; in copy_pidfd_info_to_user() 495 unsigned int info_mode, int pidfd, in copy_info_records_to_user() argument 596 ret = copy_pidfd_info_to_user(pidfd, buf, count); in copy_info_records_to_user() 627 int ret, pidfd = FAN_NOPIDFD, fd = FAN_NOFD; in copy_event_to_user() local 679 pidfd = FAN_NOPIDFD; in copy_event_to_user() 681 pidfd = pidfd_create(event->pid, 0); in copy_event_to_user() 682 if (pidfd < 0) in copy_event_to_user() 683 pidfd = FAN_EPIDFD; in copy_event_to_user() 705 ret = copy_info_records_to_user(event, info, info_mode, pidfd, in copy_event_to_user() [all …]
|
/linux-6.1.9/kernel/ |
D | pid.c | 560 struct task_struct *pidfd_get_task(int pidfd, unsigned int *flags) in pidfd_get_task() argument 566 pid = pidfd_get_pid(pidfd, &f_flags); in pidfd_get_task() 724 SYSCALL_DEFINE3(pidfd_getfd, int, pidfd, int, fd, in SYSCALL_DEFINE3() argument 735 f = fdget(pidfd); in SYSCALL_DEFINE3()
|
D | fork.c | 1997 int pidfd = -1, retval; in copy_process() local 2290 pidfd = retval; in copy_process() 2295 put_unused_fd(pidfd); in copy_process() 2301 retval = put_user(pidfd, args->pidfd); in copy_process() 2486 fd_install(pidfd, pidfile); in copy_process() 2508 put_unused_fd(pidfd); in copy_process() 2655 (args->pidfd == args->parent_tid)) in kernel_clone() 2809 .pidfd = parent_tidptr, in SYSCALL_DEFINE5() 2871 .pidfd = u64_to_user_ptr(args.pidfd), in copy_clone_args_from_user()
|
/linux-6.1.9/tools/testing/selftests/clone3/ |
D | clone3_selftests.h | 28 __aligned_u64 pidfd; member
|
/linux-6.1.9/tools/include/uapi/linux/ |
D | sched.h | 94 __aligned_u64 pidfd; member
|
/linux-6.1.9/include/uapi/linux/ |
D | sched.h | 94 __aligned_u64 pidfd; member
|
D | fanotify.h | 182 __s32 pidfd; member
|
/linux-6.1.9/samples/ |
D | Makefile | 17 subdir-$(CONFIG_SAMPLE_PIDFD) += pidfd
|
/linux-6.1.9/include/linux/sched/ |
D | task.h | 23 int __user *pidfd; member
|
/linux-6.1.9/include/linux/ |
D | pid.h | 81 struct task_struct *pidfd_get_task(int pidfd, unsigned int *flags);
|