Home
last modified time | relevance | path

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

12

/linux/tools/testing/selftests/namespaces/
H A Dlistns_permissions_test.c39 int pipefd[2]; in TEST() local
45 ASSERT_EQ(pipe(pipefd), 0); in TEST()
56 close(pipefd[0]); in TEST()
60 close(pipefd[1]); in TEST()
66 close(pipefd[1]); in TEST()
73 close(pipefd[1]); in TEST()
79 close(pipefd[1]); in TEST()
87 close(pipefd[1]); in TEST()
105 write(pipefd[1], &found_ours, sizeof(found_ours)); in TEST()
106 write(pipefd[1], &unexpected_count, sizeof(unexpected_count)); in TEST()
[all …]
H A Dcred_change_test.c48 int pipefd[2]; in TEST() local
50 ASSERT_EQ(pipe(pipefd), 0); in TEST()
62 close(pipefd[0]); in TEST()
67 close(pipefd[1]); in TEST()
73 close(pipefd[1]); in TEST()
81 close(pipefd[1]); in TEST()
87 close(pipefd[1]); in TEST()
93 write(pipefd[1], &child_userns_id, sizeof(child_userns_id)); in TEST()
104 close(pipefd[1]); in TEST()
110 close(pipefd[1]); in TEST()
[all …]
H A Dfile_handle_test.c441 int pipefd[2]; in TEST() local
448 ASSERT_EQ(pipe(pipefd), 0); in TEST()
457 SKIP(free(handle); close(ns_fd); close(pipefd[0]); in TEST()
458 close(pipefd[1]); in TEST()
469 close(pipefd[0]); in TEST()
474 write(pipefd[1], "U", in TEST()
476 close(pipefd[1]); in TEST()
486 write(pipefd[1], "M", 1); /* Unable to set mappings */ in TEST()
487 close(pipefd[1]); in TEST()
508 write(pipefd[1], "N", in TEST()
[all …]
H A Dns_active_ref_test.c93 int pipefd[2]; in TEST() local
99 ASSERT_EQ(pipe(pipefd), 0); in TEST()
106 close(pipefd[0]); in TEST()
111 close(pipefd[1]); in TEST()
118 close(pipefd[1]); in TEST()
129 close(pipefd[1]); in TEST()
134 write(pipefd[1], buf, sizeof(*handle) + handle->handle_bytes); in TEST()
135 close(pipefd[1]); in TEST()
142 close(pipefd[1]); in TEST()
145 ret = read(pipefd[0], buf, sizeof(buf)); in TEST()
[all …]
H A Dnsid_test.c73 int pipefd[2]; in TEST_F() local
83 ASSERT_EQ(pipe(pipefd), 0); in TEST_F()
90 close(pipefd[0]); in TEST_F()
97 write(pipefd[1], "S", 1); /* Signal skip */ in TEST_F()
104 write(pipefd[1], "Y", 1); in TEST_F()
105 close(pipefd[1]); in TEST_F()
116 close(pipefd[1]); in TEST_F()
119 ASSERT_EQ(read(pipefd[0], &buf, 1), 1); in TEST_F()
120 close(pipefd[0]); in TEST_F()
179 int pipefd[2]; in TEST_F() local
[all …]
H A Dlistns_test.c221 int pipefd[2]; in TEST() local
239 ASSERT_EQ(pipe(pipefd), 0); in TEST()
248 close(pipefd[0]); in TEST()
252 close(pipefd[1]); in TEST()
259 close(pipefd[1]); in TEST()
265 close(pipefd[1]); in TEST()
271 write(pipefd[1], &ns_id, sizeof(ns_id)); in TEST()
272 close(pipefd[1]); in TEST()
283 close(pipefd[1]); in TEST()
284 bytes = read(pipefd[0], &new_ns_id, sizeof(new_ns_id)); in TEST()
[all …]
/linux/tools/testing/selftests/mm/
H A Dmrelease_test.c20 static int alloc_noexit(unsigned long nr_pages, int pipefd) in alloc_noexit() argument
36 if (write(pipefd, "", 1) < 0) in alloc_noexit()
66 static int child_main(int pipefd[], size_t size) in child_main() argument
71 close(pipefd[0]); in child_main()
72 res = alloc_noexit(MB(size) / psize(), pipefd[1]); in child_main()
73 close(pipefd[1]); in child_main()
79 int pipefd[2], pidfd; in main() local
107 if (pipe(pipefd)) in main()
112 close(pipefd[0]); in main()
113 close(pipefd[1]); in main()
[all …]
H A Dmemfd_secret.c91 int pipefd[2]; in test_vmsplice() local
94 if (pipe(pipefd)) { in test_vmsplice()
113 transferred = vmsplice(pipefd[1], &iov, 1, 0); in test_vmsplice()
122 close(pipefd[0]); in test_vmsplice()
123 close(pipefd[1]); in test_vmsplice()
126 static void try_process_vm_read(int fd, int pipefd[2]) in try_process_vm_read()
132 if (read(pipefd[0], &mem, sizeof(mem)) < 0) { in try_process_vm_read()
150 static void try_ptrace(int fd, int pipefd[2]) in try_ptrace()
157 if (read(pipefd[0], &mem, sizeof(mem)) < 0) { in try_ptrace()
202 void (*func)(int fd, int pipefd[2])) in test_remote_access()
[all …]
H A Drmap.c56 int pipefd[2]; member
117 close(data->pipefd[1]); in propagate_children()
123 while (read(data->pipefd[0], &buf, 1) > 0) in propagate_children()
181 ASSERT_NE(pipe(data->pipefd), -1); in FIXTURE_SETUP()
208 close(data->pipefd[0]); in FIXTURE_TEARDOWN()
H A Duffd-common.c291 if (gopts->pipefd) { in uffd_test_ctx_clear()
293 if (close(gopts->pipefd[i])) in uffd_test_ctx_clear()
296 free(gopts->pipefd); in uffd_test_ctx_clear()
297 gopts->pipefd = NULL; in uffd_test_ctx_clear()
392 gopts->pipefd = malloc(sizeof(int) * gopts->nr_parallel * 2); in uffd_test_ctx_init()
393 if (!gopts->pipefd) in uffd_test_ctx_init()
396 if (pipe2(&gopts->pipefd[cpu * 2], O_CLOEXEC | O_NONBLOCK)) in uffd_test_ctx_init()
545 pollfd[1].fd = gopts->pipefd[cpu*2]; in uffd_poll_thread()
/linux/tools/testing/selftests/net/af_unix/
H A Dtest_unix_oob.c
/linux/tools/testing/selftests/powerpc/signal/
H A 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/tools/testing/selftests/bpf/prog_tests/
H A Dd_path.c53 int pipefd[2] = { -1, -1 }; in trigger_fstat_events()
58 if (CHECK(pipe(pipefd) < 0, "trigger", "pipe failed\n")) in trigger_fstat_events()
80 ret = set_pathname(pipefd[0], pid); in trigger_fstat_events()
83 ret = set_pathname(pipefd[1], pid); in trigger_fstat_events()
103 fstat(pipefd[0], &fileStat); in trigger_fstat_events()
104 fstat(pipefd[1], &fileStat); in trigger_fstat_events()
115 syscall_close(pipefd[0]); in trigger_fstat_events()
116 syscall_close(pipefd[1]); in trigger_fstat_events()
45 int pipefd[2] = { -1, -1 }; trigger_fstat_events() local
/linux/tools/testing/selftests/perf_events/
H A 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/tools/testing/selftests/kcmp/
H A 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/tools/testing/selftests/arm64/fp/
H A Dvec-syscfg.c92 int pipefd[2]; in get_child_rdvl() local
96 ret = pipe(pipefd); in get_child_rdvl()
109 close(pipefd[0]); in get_child_rdvl()
110 close(pipefd[1]); in get_child_rdvl()
120 ret = dup2(pipefd[1], 1); in get_child_rdvl()
134 close(pipefd[1]); in get_child_rdvl()
142 close(pipefd[0]); in get_child_rdvl()
151 close(pipefd[0]); in get_child_rdvl()
158 close(pipefd[0]); in get_child_rdvl()
162 out = fdopen(pipefd[0], "r"); in get_child_rdvl()
[all …]
/linux/tools/testing/selftests/powerpc/dexcr/
H A Dhashchk_test.c126 int pipefd[2]; in hashchk_exec_random_key_test() local
132 FAIL_IF_MSG(pipe(pipefd), "failed to create pipe"); in hashchk_exec_random_key_test()
136 if (dup2(pipefd[1], STDOUT_FILENO) == -1) in hashchk_exec_random_key_test()
144 FAIL_IF_MSG(read(pipefd[0], hash_values, sizeof(hash_values)) != sizeof(hash_values), in hashchk_exec_random_key_test()
/linux/tools/testing/selftests/riscv/abi/
H A Dpointer_masking.c23 static int pipefd[2]; variable
247 ret = write(pipefd[1], p, sizeof(*p)); in test_tagged_addr_abi_pmlen()
263 ret = write(pipefd[1], p, sizeof(*p)); in test_tagged_addr_abi_pmlen()
285 ret = write(pipefd[1], p, sizeof(*p)); in test_tagged_addr_abi_pmlen()
333 ret = pipe(pipefd); in main()
/linux/samples/watch_queue/
H A Dwatch_test.c162 int pipefd[2], fd; in main() local
164 if (pipe2(pipefd, O_NOTIFICATION_PIPE) == -1) { in main()
168 fd = pipefd[0]; in main()
/linux/tools/testing/selftests/net/mptcp/
H A Dmptcp_sockopt.c569 static void connect_one_server(int fd, int pipefd) in connect_one_server() argument
594 ret = read(pipefd, buf2, 4); in connect_one_server()
596 close(pipefd); in connect_one_server()
638 static void process_one_client(int fd, int pipefd) in process_one_client() argument
647 ret = write(pipefd, "xmit", 4); in process_one_client()
705 static int server(int pipefd) in server() argument
721 r = write(pipefd, "conn", 4); in server()
727 process_one_client(r, pipefd); in server()
771 static int client(int pipefd) in client() argument
790 connect_one_server(fd, pipefd); in client()
/linux/tools/testing/selftests/arm64/gcs/
H A Dgcs-stress.c61 int ret, pipefd[2], i; in start_thread() local
64 ret = pipe(pipefd); in start_thread()
79 ret = dup2(pipefd[1], 1); in start_thread()
126 close(pipefd[1]); in start_thread()
127 child->stdout = pipefd[0]; in start_thread()
/linux/fs/autofs/
H A Ddev-ioctl.c329 int pipefd; in autofs_dev_ioctl_setpipefd() local
333 if (param->setpipefd.pipefd == -1) in autofs_dev_ioctl_setpipefd()
336 pipefd = param->setpipefd.pipefd; in autofs_dev_ioctl_setpipefd()
353 pipe = fget(pipefd); in autofs_dev_ioctl_setpipefd()
364 sbi->pipefd = pipefd; in autofs_dev_ioctl_setpipefd()
H A Dinode.c71 seq_printf(m, ",fd=%d", sbi->pipefd); in autofs_show_options()
186 sbi->pipefd = result->uint_32; in autofs_parse_fd()
253 sbi->pipefd = -1; in autofs_alloc_sbi()
357 sbi->pipefd, pid_nr(sbi->oz_pgrp)); in autofs_fill_super()
375 if (sbi->pipefd < 0) in autofs_get_tree()
/linux/tools/testing/selftests/exec/
H A Dcheck-exec.c73 int memfd, pipefd; in FIXTURE() local
164 self->pipefd = open(procfd_path, O_RDWR | O_CLOEXEC); in FIXTURE_SETUP()
165 ASSERT_LE(0, self->pipefd); in FIXTURE_SETUP()
166 ASSERT_EQ(0, fchmod(self->pipefd, variant->file_exec ? 0700 : 0600)); in FIXTURE_SETUP()
319 test_exec_fd(_metadata, self->pipefd, EACCES); in TEST_F()
/linux/tools/include/nolibc/
H A Dsys.h700 int sys_pipe2(int pipefd[2], int flags) in sys_pipe2()
702 return my_syscall2(__NR_pipe2, pipefd, flags); in sys_pipe2()
706 int pipe2(int pipefd[2], int flags) in pipe2()
708 return __sysret(sys_pipe2(pipefd, flags)); in pipe2()
712 int pipe(int pipefd[2]) in pipe()
714 return pipe2(pipefd, 0); in pipe()

12