Lines Matching refs:pidfd

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()
121 if (pidfd < 0) in test_pidfd_send_signal_exited_fail()
126 ret = sys_pidfd_send_signal(pidfd, 0, NULL, 0); in test_pidfd_send_signal_exited_fail()
128 close(pidfd); in test_pidfd_send_signal_exited_fail()
201 int pidfd = -1; in test_pidfd_send_signal_recycled_pid_fail() local
220 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_recycled_pid_fail()
236 close(pidfd); in test_pidfd_send_signal_recycled_pid_fail()
240 if (pidfd < 0) in test_pidfd_send_signal_recycled_pid_fail()
283 ret = sys_pidfd_send_signal(pidfd, SIGCONT, in test_pidfd_send_signal_recycled_pid_fail()
353 int pidfd, ret; in test_pidfd_send_signal_syscall_support() local
356 pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_syscall_support()
357 if (pidfd < 0) in test_pidfd_send_signal_syscall_support()
362 ret = sys_pidfd_send_signal(pidfd, 0, NULL, 0); in test_pidfd_send_signal_syscall_support()
375 close(pidfd); in test_pidfd_send_signal_syscall_support()
395 static void poll_pidfd(const char *test_name, int pidfd) in poll_pidfd() argument
407 event.data.fd = pidfd; in poll_pidfd()
409 if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, pidfd, &event)) { in poll_pidfd()
445 int pid, pidfd = 0; in test_pidfd_poll_exec() local
451 pid = pidfd_clone(CLONE_PIDFD, &pidfd, child_poll_exec_test); in test_pidfd_poll_exec()
466 poll_pidfd(test_name, pidfd); in test_pidfd_poll_exec()
473 close(pidfd); in test_pidfd_poll_exec()
511 int pid, pidfd = 0; in test_pidfd_poll_leader_exit() local
524 pid = pidfd_clone(CLONE_PIDFD, &pidfd, child_poll_leader_exit_test); in test_pidfd_poll_leader_exit()
542 poll_pidfd(test_name, pidfd); in test_pidfd_poll_leader_exit()
552 close(pidfd); in test_pidfd_poll_leader_exit()