Home
last modified time | relevance | path

Searched refs:pipefd (Results 1 – 25 of 31) sorted by relevance

12

/linux-6.6.21/tools/testing/selftests/mm/
Dmrelease_test.c20 static int alloc_noexit(unsigned long nr_pages, int pipefd) in alloc_noexit() argument
38 if (write(pipefd, "", 1) < 0) { in alloc_noexit()
76 static int child_main(int pipefd[], size_t size) in child_main() argument
81 close(pipefd[0]); in child_main()
82 res = alloc_noexit(MB(size) / psize(), pipefd[1]); in child_main()
83 close(pipefd[1]); in child_main()
89 int pipefd[2], pidfd; in main() local
110 if (pipe(pipefd)) { in main()
117 close(pipefd[0]); in main()
118 close(pipefd[1]); in main()
[all …]
Dmemfd_secret.c86 static void try_process_vm_read(int fd, int pipefd[2]) in try_process_vm_read()
92 if (read(pipefd[0], &mem, sizeof(mem)) < 0) { in try_process_vm_read()
110 static void try_ptrace(int fd, int pipefd[2]) in try_ptrace()
117 if (read(pipefd[0], &mem, sizeof(mem)) < 0) { in try_ptrace()
162 void (*func)(int fd, int pipefd[2])) in test_remote_access()
164 int pipefd[2]; in test_remote_access() local
168 if (pipe(pipefd)) { in test_remote_access()
180 func(fd, pipefd); in test_remote_access()
193 if (write(pipefd[1], &mem, sizeof(mem)) < 0) { in test_remote_access()
Duffd-common.c15 int uffd = -1, uffd_flags, finished, *pipefd, test_type; variable
269 if (pipefd) { in uffd_test_ctx_clear()
271 if (close(pipefd[i])) in uffd_test_ctx_clear()
274 free(pipefd); in uffd_test_ctx_clear()
275 pipefd = NULL; in uffd_test_ctx_clear()
356 pipefd = malloc(sizeof(int) * nr_cpus * 2); in uffd_test_ctx_init()
357 if (!pipefd) in uffd_test_ctx_init()
360 if (pipe2(&pipefd[cpu * 2], O_CLOEXEC | O_NONBLOCK)) in uffd_test_ctx_init()
507 pollfd[1].fd = pipefd[cpu*2]; in uffd_poll_thread()
Duffd-common.h95 extern int uffd, uffd_flags, finished, *pipefd, test_type;
Duffd-unit-tests.c592 if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) in uffd_minor_test_common()
798 if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) in uffd_sigbus_test_common()
846 if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) in uffd_events_test_common()
1053 if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) in uffd_poison_test()
/linux-6.6.21/tools/testing/selftests/net/af_unix/
Dtest_unix_oob.c16 static int pipefd[2]; variable
125 wait_for_signal(pipefd[0]); in producer()
135 wait_for_signal(pipefd[0]); in producer()
140 wait_for_signal(pipefd[0]); in producer()
151 wait_for_signal(pipefd[0]); in producer()
165 wait_for_signal(pipefd[0]); in producer()
200 pipe(pipefd); in main()
211 signal_producer(pipefd[1]); in main()
217 signal_producer(pipefd[1]); in main()
234 signal_producer(pipefd[1]); in main()
[all …]
/linux-6.6.21/tools/testing/selftests/resctrl/
Dcat_test.c93 int ret, pipefd[2], sibling_cpu_no; in cat_perf_miss_val() local
151 if (pipe(pipefd)) { in cat_perf_miss_val()
180 close(pipefd[0]); in cat_perf_miss_val()
182 if (write(pipefd[1], &pipe_message, sizeof(pipe_message)) < in cat_perf_miss_val()
190 close(pipefd[1]); in cat_perf_miss_val()
195 close(pipefd[1]); in cat_perf_miss_val()
198 if (read(pipefd[0], &pipe_message, in cat_perf_miss_val()
204 close(pipefd[0]); in cat_perf_miss_val()
Dresctrl_val.c641 int ret = 0, pipefd[2]; in resctrl_val() local
661 if (pipe(pipefd)) { in resctrl_val()
695 close(pipefd[0]); in resctrl_val()
697 if (write(pipefd[1], &pipe_message, sizeof(pipe_message)) < in resctrl_val()
700 close(pipefd[1]); in resctrl_val()
703 close(pipefd[1]); in resctrl_val()
745 close(pipefd[1]); in resctrl_val()
747 if (read(pipefd[0], &pipe_message, sizeof(pipe_message)) < in resctrl_val()
750 close(pipefd[0]); in resctrl_val()
754 close(pipefd[0]); in resctrl_val()
/linux-6.6.21/tools/testing/selftests/powerpc/signal/
Dsig_sc_double_restart.c83 int pipefd[2]; in test_restart() local
87 if (pipe(pipefd) == -1) { in test_restart()
120 while ((fd = dup(pipefd[0])) != 512) { in test_restart()
149 if (write(pipefd[1], DATA, DLEN) != DLEN) { in test_restart()
153 close(pipefd[0]); in test_restart()
154 close(pipefd[1]); in test_restart()
/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/
Dd_path.c45 int pipefd[2] = { -1, -1 }; in trigger_fstat_events() local
50 if (CHECK(pipe(pipefd) < 0, "trigger", "pipe failed\n")) in trigger_fstat_events()
72 ret = set_pathname(pipefd[0], pid); in trigger_fstat_events()
75 ret = set_pathname(pipefd[1], pid); in trigger_fstat_events()
95 fstat(pipefd[0], &fileStat); in trigger_fstat_events()
96 fstat(pipefd[1], &fileStat); in trigger_fstat_events()
109 close(pipefd[0]); in trigger_fstat_events()
110 close(pipefd[1]); in trigger_fstat_events()
/linux-6.6.21/tools/testing/selftests/perf_events/
Dremove_on_exec.c124 int pipefd[2]; in TEST_F() local
138 ASSERT_NE(pipe(pipefd), -1); in TEST_F()
141 ASSERT_NE(dup2(pipefd[1], STDOUT_FILENO), -1); in TEST_F()
142 close(pipefd[0]); in TEST_F()
146 close(pipefd[1]); in TEST_F()
150 EXPECT_EQ(read(pipefd[0], &tmp, sizeof(int)), sizeof(int)); in TEST_F()
152 close(pipefd[0]); in TEST_F()
/linux-6.6.21/tools/testing/selftests/kcmp/
Dkcmp_test.c36 int pipefd[2]; in main() local
50 if (pipe(pipefd)) { in main()
64 if (epoll_ctl(epollfd, EPOLL_CTL_ADD, pipefd[0], &ev)) { in main()
69 fddup = dup2(pipefd[1], duped_num); in main()
146 ret = sys_kcmp(pid1, pid1, KCMP_EPOLL_TFD, pipefd[1], in main()
/linux-6.6.21/fs/autofs/
Dinode.c70 seq_printf(m, ",fd=%d", sbi->pipefd); in autofs_show_options()
139 int pipefd = -1; in parse_options() local
149 sbi->pipefd = -1; in parse_options()
163 if (match_int(args, &pipefd)) in parse_options()
165 sbi->pipefd = pipefd; in parse_options()
218 return (sbi->pipefd < 0); in parse_options()
239 sbi->pipefd = -1; in autofs_fill_super()
323 sbi->pipefd, pid_nr(sbi->oz_pgrp)); in autofs_fill_super()
324 pipe = fget(sbi->pipefd); in autofs_fill_super()
Ddev-ioctl.c342 int pipefd; in autofs_dev_ioctl_setpipefd() local
346 if (param->setpipefd.pipefd == -1) in autofs_dev_ioctl_setpipefd()
349 pipefd = param->setpipefd.pipefd; in autofs_dev_ioctl_setpipefd()
366 pipe = fget(pipefd); in autofs_dev_ioctl_setpipefd()
377 sbi->pipefd = pipefd; in autofs_dev_ioctl_setpipefd()
/linux-6.6.21/tools/testing/selftests/arm64/fp/
Dvec-syscfg.c87 int pipefd[2]; in get_child_rdvl() local
91 ret = pipe(pipefd); in get_child_rdvl()
104 close(pipefd[0]); in get_child_rdvl()
105 close(pipefd[1]); in get_child_rdvl()
115 ret = dup2(pipefd[1], 1); in get_child_rdvl()
129 close(pipefd[1]); in get_child_rdvl()
137 close(pipefd[0]); in get_child_rdvl()
146 close(pipefd[0]); in get_child_rdvl()
153 close(pipefd[0]); in get_child_rdvl()
157 out = fdopen(pipefd[0], "r"); in get_child_rdvl()
[all …]
Dfp-stress.c62 int ret, pipefd[2], i; in child_start() local
65 ret = pipe(pipefd); in child_start()
80 ret = dup2(pipefd[1], 1); in child_start()
127 close(pipefd[1]); in child_start()
128 child->stdout = pipefd[0]; in child_start()
/linux-6.6.21/tools/testing/selftests/powerpc/dexcr/
Dhashchk_test.c120 int pipefd[2]; in hashchk_exec_random_key_test() local
126 FAIL_IF_MSG(pipe(pipefd), "failed to create pipe"); in hashchk_exec_random_key_test()
130 if (dup2(pipefd[1], STDOUT_FILENO) == -1) in hashchk_exec_random_key_test()
138 FAIL_IF_MSG(read(pipefd[0], hash_values, sizeof(hash_values)) != sizeof(hash_values), in hashchk_exec_random_key_test()
/linux-6.6.21/samples/watch_queue/
Dwatch_test.c156 int pipefd[2], fd; in main() local
158 if (pipe2(pipefd, O_NOTIFICATION_PIPE) == -1) { in main()
162 fd = pipefd[0]; in main()
/linux-6.6.21/tools/testing/selftests/net/mptcp/
Dmptcp_sockopt.c560 static void connect_one_server(int fd, int pipefd) in connect_one_server() argument
585 ret = read(pipefd, buf2, 4); in connect_one_server()
587 close(pipefd); in connect_one_server()
629 static void process_one_client(int fd, int pipefd) in process_one_client() argument
638 ret = write(pipefd, "xmit", 4); in process_one_client()
692 static int server(int pipefd) in server() argument
708 r = write(pipefd, "conn", 4); in server()
714 process_one_client(r, pipefd); in server()
757 static int client(int pipefd) in client() argument
776 connect_one_server(fd, pipefd); in client()
/linux-6.6.21/tools/testing/selftests/proc/
Dproc-pid-vm.c285 int pipefd[2]; in main() local
315 if (pipe(pipefd) == -1) { in main()
318 if (dup2(pipefd[1], 0) != 0) { in main()
332 if (read(pipefd[0], &_, 1) != 1) { in main()
/linux-6.6.21/tools/testing/selftests/kvm/lib/
Duserfaultfd_util.c32 int pipefd = uffd_desc->pipefds[0]; in uffd_handler_thread_fn() local
47 pollfd[1].fd = pipefd; in uffd_handler_thread_fn()
/linux-6.6.21/tools/include/nolibc/
Dsys.h772 int sys_pipe2(int pipefd[2], int flags) in sys_pipe2()
774 return my_syscall2(__NR_pipe2, pipefd, flags); in sys_pipe2()
778 int pipe2(int pipefd[2], int flags) in pipe2()
780 return __sysret(sys_pipe2(pipefd, flags)); in pipe2()
784 int pipe(int pipefd[2]) in pipe()
786 return pipe2(pipefd, 0); in pipe()
/linux-6.6.21/tools/perf/tests/
Dcode-reading.c476 int pipefd[2]; in syscall_something() local
480 if (pipe(pipefd) < 0) { in syscall_something()
484 close(pipefd[1]); in syscall_something()
485 close(pipefd[0]); in syscall_something()
/linux-6.6.21/tools/testing/selftests/seccomp/
Dseccomp_bpf.c1589 int pipefd[2]; in setup_trace_fixture() local
1594 ASSERT_EQ(0, pipe(pipefd)); in setup_trace_fixture()
1601 close(pipefd[0]); in setup_trace_fixture()
1602 start_tracer(_metadata, pipefd[1], tracee, func, args, in setup_trace_fixture()
1606 close(pipefd[1]); in setup_trace_fixture()
1608 read(pipefd[0], &sync, 1); in setup_trace_fixture()
1609 close(pipefd[0]); in setup_trace_fixture()
3009 int pipefd[2]; in TEST() local
3043 ASSERT_EQ(0, pipe(pipefd)); in TEST()
3056 EXPECT_EQ(0, close(pipefd[1])); in TEST()
[all …]
/linux-6.6.21/include/uapi/linux/
Dauto_dev-ioctl.h50 __s32 pipefd; member

12