Home
last modified time | relevance | path

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

12

/third_party/musl/libc-test/src/functionalext/supplement/unistd/
Dpipe2.c26 int pipefd[TEST_FD_SIZE]; in pipe2_test() local
28 int ret = pipe2(pipefd, flag); in pipe2_test()
37 close(pipefd[1]); in pipe2_test()
38 while (read(pipefd[0], buf, 1) > 0) { in pipe2_test()
41 close(pipefd[0]); in pipe2_test()
45 close(pipefd[0]); in pipe2_test()
46 write(pipefd[1], buf, 1); in pipe2_test()
47 close(pipefd[1]); in pipe2_test()
50 close(pipefd[0]); in pipe2_test()
51 close(pipefd[1]); in pipe2_test()
/third_party/ltp/testcases/kernel/syscalls/sendmsg/
Dsendmsg02.c62 static void client(int id, int pipefd[]) in client() argument
71 close(pipefd[0]); in client()
92 write(pipefd[1], &fd, 1); in client()
97 close(pipefd[1]); in client()
100 static void server(int id, int pipefd[]) in server() argument
105 close(pipefd[1]); in server()
115 read(pipefd[0], &fd, 1); in server()
119 close(pipefd[0]); in server()
124 int i, status, pipefd[2]; in reproduce() local
140 if (pipe(pipefd) < 0) { in reproduce()
[all …]
/third_party/pulseaudio/src/tests/
Dsrbchannel-test.c85 int pipefd[4]; in START_TEST() local
94 fail_unless(pipe(pipefd) == 0); in START_TEST()
95 fail_unless(pipe(&pipefd[2]) == 0); in START_TEST()
96 io1 = pa_iochannel_new(pa_mainloop_get_api(ml), pipefd[2], pipefd[1]); in START_TEST()
97 io2 = pa_iochannel_new(pa_mainloop_get_api(ml), pipefd[0], pipefd[3]); in START_TEST()
101 pa_log_debug("Pipes: fd %d -> %d, %d -> %d", pipefd[1], pipefd[0], pipefd[3], pipefd[2]); in START_TEST()
/third_party/ninja/src/
Dbrowse.cc29 int pipefd[2]; in RunBrowsePython() local
30 if (pipe(pipefd) < 0) { in RunBrowsePython()
42 close(pipefd[1]); in RunBrowsePython()
44 if (dup2(pipefd[0], 0) < 0) { in RunBrowsePython()
69 close(pipefd[0]); in RunBrowsePython()
72 ssize_t len = write(pipefd[1], kBrowsePy, sizeof(kBrowsePy)); in RunBrowsePython()
75 close(pipefd[1]); in RunBrowsePython()
/third_party/ltp/testcases/kernel/containers/pidns/
Dpidns12.c50 int pipefd[2]; variable
85 close(pipefd[0]); in child_fn()
97 if (write(pipefd[1], "c:go\0", 5) != 5) { in child_fn()
104 close(pipefd[1]); in child_fn()
132 if (pipe(pipefd) == -1) { in main()
142 close(pipefd[1]); in main()
145 read(pipefd[0], buf, 5); in main()
164 close(pipefd[0]); in main()
/third_party/libusb/libusb/os/
Devents_posix.c37 #define EVENT_READ_FD(e) ((e)->pipefd[0])
38 #define EVENT_WRITE_FD(e) ((e)->pipefd[1])
59 int ret = pipe2(event->pipefd, O_CLOEXEC); in usbi_create_event()
61 int ret = pipe(event->pipefd); in usbi_create_event()
70 ret = fcntl(event->pipefd[0], F_GETFD); in usbi_create_event()
75 ret = fcntl(event->pipefd[0], F_SETFD, ret | FD_CLOEXEC); in usbi_create_event()
81 ret = fcntl(event->pipefd[1], F_GETFD); in usbi_create_event()
86 ret = fcntl(event->pipefd[1], F_SETFD, ret | FD_CLOEXEC); in usbi_create_event()
93 ret = fcntl(event->pipefd[1], F_GETFL); in usbi_create_event()
98 ret = fcntl(event->pipefd[1], F_SETFL, ret | O_NONBLOCK); in usbi_create_event()
[all …]
Devents_posix.h38 int pipefd[2]; member
40 #define USBI_EVENT_OS_HANDLE(e) ((e)->pipefd[0])
/third_party/glib/glib/tests/
Dunix.c34 int pipefd[2]; in test_pipe() local
39 res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error); in test_pipe()
43 write (pipefd[1], "hello", sizeof ("hello")); in test_pipe()
45 bytes_read = read (pipefd[0], buf, sizeof(buf) - 1); in test_pipe()
49 close (pipefd[0]); in test_pipe()
50 close (pipefd[1]); in test_pipe()
72 int pipefd[2]; in test_nonblocking() local
76 res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error); in test_nonblocking()
80 res = g_unix_set_fd_nonblocking (pipefd[0], TRUE, &error); in test_nonblocking()
84 flags = fcntl (pipefd[0], F_GETFL); in test_nonblocking()
[all …]
/third_party/ltp/testcases/kernel/syscalls/pipe/
Dpipe09.c80 int pipefd[2]; /* fds for pipe read/write */ in main() local
94 TEST(pipe(pipefd)); in main()
106 if (close(pipefd[0]) != 0) { in main()
113 if (write(pipefd[1], "A", 1) != 1) { in main()
133 if (close(pipefd[0]) != 0) { in main()
139 if (write(pipefd[1], "B", 1) != 1) { in main()
155 if (close(pipefd[1]) != 0) { in main()
160 while ((red = do_read(pipefd[0], rebuf, 100)) > 0) { in main()
Dpipe08.c67 int pipefd[2]; /* fds for pipe read/write */ in main() local
81 TEST(pipe(pipefd)); in main()
88 if ((close_stat = close(pipefd[0])) == -1) { in main()
100 written = write(pipefd[1], wrbuf, length); in main()
/third_party/wayland_standard/tests/
Dtest-runner.c235 int pipefd[2]; in is_debugger_attached() local
237 if (pipe(pipefd) == -1) { in is_debugger_attached()
245 close(pipefd[0]); in is_debugger_attached()
246 close(pipefd[1]); in is_debugger_attached()
253 close(pipefd[1]); /* Close unused write end */ in is_debugger_attached()
254 read(pipefd[0], &buf, 1); in is_debugger_attached()
255 close(pipefd[0]); in is_debugger_attached()
266 close(pipefd[0]); in is_debugger_attached()
277 write(pipefd[1], "-", 1); in is_debugger_attached()
280 write(pipefd[1], "+", 1); in is_debugger_attached()
[all …]
/third_party/grpc/src/core/lib/iomgr/
Dwakeup_fd_pipe.cc37 int pipefd[2]; in pipe_init() local
38 int r = pipe(pipefd); in pipe_init()
44 err = grpc_set_socket_nonblocking(pipefd[0], 1); in pipe_init()
46 err = grpc_set_socket_nonblocking(pipefd[1], 1); in pipe_init()
48 fd_info->read_fd = pipefd[0]; in pipe_init()
49 fd_info->write_fd = pipefd[1]; in pipe_init()
/third_party/glib/gio/tests/
Dtest-pipe-unix.c56 int pipefd[2]; in test_pipe() local
59 ret = pipe (pipefd); in test_pipe()
71 *is = g_unix_input_stream_new (pipefd[0], TRUE); in test_pipe()
73 close (pipefd[0]); in test_pipe()
76 *os = g_unix_output_stream_new (pipefd[1], TRUE); in test_pipe()
78 close (pipefd[1]); in test_pipe()
/third_party/ltp/testcases/kernel/syscalls/setrlimit/
Dsetrlimit01.c126 int pipefd[2]; in test2() local
128 SAFE_PIPE(NULL, pipefd); in test2()
142 close(pipefd[0]); /* close unused read end */ in test2()
154 if (write(pipefd[1], &bytes, sizeof(bytes)) < (long)sizeof(bytes)) { in test2()
157 close(pipefd[1]); /* EOF */ in test2()
178 close(pipefd[1]); /* close unused write end */ in test2()
179 if (read(pipefd[0], &bytes, sizeof(bytes)) < (long)sizeof(bytes)) in test2()
182 close(pipefd[0]); in test2()
/third_party/libuv/src/unix/
Dasync.c203 int pipefd[2]; in uv__async_start() local
214 pipefd[0] = err; in uv__async_start()
215 pipefd[1] = -1; in uv__async_start()
217 err = uv__make_pipe(pipefd, UV_NONBLOCK_PIPE); in uv__async_start()
222 uv__io_init(&loop->async_io_watcher, uv__async_io, pipefd[0]); in uv__async_start()
224 loop->async_wfd = pipefd[1]; in uv__async_start()
/third_party/ltp/testcases/kernel/syscalls/write/
Dwrite05.c32 static int pipefd[2]; variable
42 {&pipefd[1], &buf, sizeof(buf), EPIPE},
88 SAFE_PIPE(pipefd); in setup()
89 SAFE_CLOSE(pipefd[0]); in setup()
/third_party/weston/tests/
Dlinux-explicit-synchronization-test.c124 int pipefd[2] = { -1, -1 }; in TEST() local
126 assert(pipe(pipefd) == 0); in TEST()
129 pipefd[0]); in TEST()
135 close(pipefd[0]); in TEST()
136 close(pipefd[1]); in TEST()
149 int pipefd[2] = { -1, -1 }; in TEST() local
151 assert(pipe(pipefd) == 0); in TEST()
155 pipefd[0]); in TEST()
161 close(pipefd[0]); in TEST()
162 close(pipefd[1]); in TEST()
/third_party/libuv/test/
Drunner-unix.c86 int pipefd[2]; in process_start() local
119 if (pipe(pipefd)) { in process_start()
124 snprintf(fdstr, sizeof(fdstr), "%d", pipefd[1]); in process_start()
144 closefd(pipefd[0]); in process_start()
158 closefd(pipefd[1]); in process_start()
162 rc = read(pipefd[0], &n, 1); in process_start()
165 closefd(pipefd[0]); in process_start()
/third_party/ltp/testcases/kernel/logging/kmsg/
Dkmsg01.c176 int pipefd[2]; in timed_read_kmsg() local
179 if (pipe(pipefd) != 0) in timed_read_kmsg()
189 close(pipefd[0]); in timed_read_kmsg()
191 if (write(pipefd[1], "", 1) == -1) in timed_read_kmsg()
202 close(pipefd[1]); in timed_read_kmsg()
205 SAFE_CLOSE(pipefd[1]); in timed_read_kmsg()
209 TEST(timed_read(pipefd[0], timeout_usec)); in timed_read_kmsg()
211 SAFE_CLOSE(pipefd[0]); in timed_read_kmsg()
/third_party/libunwind/src/x86_64/
DGinit.c83 do_pipe2 (int pipefd[2]) in do_pipe2()
85 int result UNUSED = pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2()
102 do_pipe2 (int pipefd[2]) in do_pipe2()
104 pipe (pipefd); in do_pipe2()
105 set_pipe_flags(pipefd[0]); in do_pipe2()
106 set_pipe_flags(pipefd[1]); in do_pipe2()
/third_party/libunwind/src/riscv/
DGinit.c107 do_pipe2 (int pipefd[2]) in do_pipe2()
109 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2()
126 do_pipe2 (int pipefd[2]) in do_pipe2()
128 pipe (pipefd); in do_pipe2()
129 set_pipe_flags(pipefd[0]); in do_pipe2()
130 set_pipe_flags(pipefd[1]); in do_pipe2()
/third_party/libunwind/src/arm/
DGinit.c85 do_pipe2 (int pipefd[2]) in do_pipe2()
87 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2()
104 do_pipe2 (int pipefd[2]) in do_pipe2()
106 pipe (pipefd); in do_pipe2()
107 set_pipe_flags(pipefd[0]); in do_pipe2()
108 set_pipe_flags(pipefd[1]); in do_pipe2()
/third_party/libunwind/src/aarch64/
DGinit.c98 do_pipe2 (int pipefd[2]) in do_pipe2()
100 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2()
117 do_pipe2 (int pipefd[2]) in do_pipe2()
119 pipe (pipefd); in do_pipe2()
120 set_pipe_flags(pipefd[0]); in do_pipe2()
121 set_pipe_flags(pipefd[1]); in do_pipe2()
/third_party/toybox/toys/posix/
Dtar.c853 int pipefd[2] = {hdr ? -1 : TT.fd, -1}, i, pid; in tar_main() local
859 (char *[]){archiver, "-dc", 0}, pipefd); in tar_main()
865 TT.fd = pipefd[1]; in tar_main()
874 dup2(pipefd[0], 0); in tar_main()
875 if (pipefd[0]) close(pipefd[0]); in tar_main()
879 pipefd[0] = pipefd[1]; in tar_main()
880 pipefd[1] = 1; in tar_main()
881 pid = xpopen_both(0, pipefd); in tar_main()
882 close(pipefd[1]); in tar_main()
927 int pipefd[2] = {-1, TT.fd}; in tar_main() local
[all …]
/third_party/nghttp2/examples/
Dlibevent-server.c437 int pipefd[2]; in error_reply() local
440 rv = pipe(pipefd); in error_reply()
453 writelen = write(pipefd[1], ERROR_HTML, sizeof(ERROR_HTML) - 1); in error_reply()
454 close(pipefd[1]); in error_reply()
457 close(pipefd[0]); in error_reply()
461 stream_data->fd = pipefd[0]; in error_reply()
464 pipefd[0]) != 0) { in error_reply()
465 close(pipefd[0]); in error_reply()

12