| /linux/tools/testing/selftests/pidfd/ |
| A D | pidfd_wait.c | 42 int pidfd = -1, status = 0; in TEST() local 46 .pidfd = ptr_to_u64(&pidfd), in TEST() 57 ASSERT_GE(pidfd, 0); in TEST() 61 EXPECT_EQ(close(pidfd), 0); in TEST() 62 pidfd = -1; in TEST() 65 ASSERT_GE(pidfd, 0); in TEST() 70 pidfd = -1; in TEST() 95 .pidfd = ptr_to_u64(&pidfd), in TEST() 143 int pidfd, status = 0; in TEST() local 162 EXPECT_GE(pidfd, 0) { in TEST() [all …]
|
| A D | pidfd_test.c | 59 int pidfd, ret; in test_pidfd_send_signal_simple_success() local 70 if (pidfd < 0) in test_pidfd_send_signal_simple_success() 78 close(pidfd); in test_pidfd_send_signal_simple_success() 120 if (pidfd < 0) in test_pidfd_send_signal_exited_fail() 127 close(pidfd); in test_pidfd_send_signal_exited_fail() 235 close(pidfd); in test_pidfd_send_signal_recycled_pid_fail() 239 if (pidfd < 0) in test_pidfd_send_signal_recycled_pid_fail() 356 if (pidfd < 0) in test_pidfd_send_signal_syscall_support() 374 close(pidfd); in test_pidfd_send_signal_syscall_support() 471 close(pidfd); in test_pidfd_poll_exec() [all …]
|
| A D | pidfd_open_test.c | 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() 159 if (pidfd >= 0) in main() [all …]
|
| A 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()
|
| A 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()
|
| A D | pidfd.h | 95 static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info, in sys_pidfd_send_signal() argument 98 return syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags); in sys_pidfd_send_signal() 101 static inline int sys_pidfd_getfd(int pidfd, int fd, int flags) in sys_pidfd_getfd() argument 103 return syscall(__NR_pidfd_getfd, pidfd, fd, flags); in sys_pidfd_getfd()
|
| A D | pidfd_fdinfo_test.c | 149 static int verify_fdinfo(int pidfd, struct error *err, const char *prefix, in verify_fdinfo() argument 166 snprintf(path, sizeof(path), "/proc/self/fdinfo/%d", pidfd); in verify_fdinfo() 170 pidfd); in verify_fdinfo() 196 prefix, pidfd); in verify_fdinfo() 204 int pidfd; in child_fdinfo_nspid_test() local 228 pidfd = *(int *)args; in child_fdinfo_nspid_test() 229 r = verify_fdinfo(pidfd, &err, "NSpid:", 6, "\t0\n"); in child_fdinfo_nspid_test()
|
| A 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/samples/pidfd/ |
| A 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() 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() 100 procfd = pidfd_metadata_fd(pid, pidfd); in main() [all …]
|
| A D | .gitignore | 2 /pidfd-metadata
|
| A D | Makefile | 2 usertprogs-always-y += pidfd-metadata
|
| /linux/tools/testing/selftests/pid_namespace/ |
| A D | Makefile | 8 $(OUTPUT)/regression_enomem: regression_enomem.c ../pidfd/pidfd.h
|
| /linux/tools/testing/selftests/cgroup/ |
| A D | Makefile | 20 $(OUTPUT)/test_kill: cgroup_util.c ../clone3/clone3_selftests.h ../pidfd/pidfd.h
|
| /linux/fs/notify/fanotify/ |
| A D | fanotify_user.c | 452 static int copy_pidfd_info_to_user(int pidfd, in copy_pidfd_info_to_user() argument 464 info.pidfd = pidfd; in copy_pidfd_info_to_user() 474 unsigned int info_mode, int pidfd, in copy_info_records_to_user() argument 551 ret = copy_pidfd_info_to_user(pidfd, buf, count); in copy_info_records_to_user() 582 int ret, pidfd = FAN_NOPIDFD, fd = FAN_NOFD; in copy_event_to_user() local 634 pidfd = FAN_NOPIDFD; in copy_event_to_user() 636 pidfd = pidfd_create(event->pid, 0); in copy_event_to_user() 637 if (pidfd < 0) in copy_event_to_user() 638 pidfd = FAN_EPIDFD; in copy_event_to_user() 677 if (pidfd >= 0) in copy_event_to_user() [all …]
|
| /linux/arch/sparc/kernel/ |
| A 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/kernel/ |
| A D | pid.c | 559 struct task_struct *pidfd_get_task(int pidfd, unsigned int *flags) in pidfd_get_task() argument 565 pid = pidfd_get_pid(pidfd, &f_flags); in pidfd_get_task() 723 SYSCALL_DEFINE3(pidfd_getfd, int, pidfd, int, fd, in SYSCALL_DEFINE3() argument 734 f = fdget(pidfd); in SYSCALL_DEFINE3()
|
| A D | fork.c | 1933 int pidfd = -1, retval; in copy_process() local 2225 pidfd = retval; in copy_process() 2230 put_unused_fd(pidfd); in copy_process() 2236 retval = put_user(pidfd, args->pidfd); in copy_process() 2355 fd_install(pidfd, pidfile); in copy_process() 2425 put_unused_fd(pidfd); in copy_process() 2561 (args->pidfd == args->parent_tid)) in kernel_clone() 2691 .pidfd = parent_tidptr, in SYSCALL_DEFINE5() 2753 .pidfd = u64_to_user_ptr(args.pidfd), in copy_clone_args_from_user()
|
| /linux/tools/testing/selftests/clone3/ |
| A D | clone3_selftests.h | 28 __aligned_u64 pidfd; member
|
| /linux/tools/include/uapi/linux/ |
| A D | sched.h | 94 __aligned_u64 pidfd; member
|
| /linux/include/uapi/linux/ |
| A D | sched.h | 94 __aligned_u64 pidfd; member
|
| A D | fanotify.h | 161 __s32 pidfd; member
|
| /linux/samples/ |
| A D | Makefile | 17 subdir-$(CONFIG_SAMPLE_PIDFD) += pidfd
|
| /linux/arch/h8300/kernel/ |
| A D | process.c | 166 kargs.pidfd = (int __user *)parent_tidptr; in sys_clone()
|
| /linux/include/linux/sched/ |
| A D | task.h | 23 int __user *pidfd; member
|
| /linux/include/linux/ |
| A D | pid.h | 81 struct task_struct *pidfd_get_task(int pidfd, unsigned int *flags);
|