/third_party/musl/libc-test/src/functionalext/supplement/unistd/ |
H A D | pipe2.c | 26 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[ in pipe2_test() [all...] |
/third_party/ltp/testcases/kernel/syscalls/pipe/ |
H A D | pipe08.c | 18 static int pipefd[2]; variable 33 SAFE_PIPE(pipefd); in run() 34 SAFE_CLOSE(pipefd[0]); in run() 36 TST_EXP_FAIL2_SILENT(write(pipefd[1], wrbuf, sizeof(wrbuf)), EPIPE); in run() 39 SAFE_CLOSE(pipefd[1]); in run() 49 if (pipefd[0] > 0) in cleanup() 50 SAFE_CLOSE(pipefd[0]); in cleanup() 51 if (pipefd[1] > 0) in cleanup() 52 SAFE_CLOSE(pipefd[1]); in cleanup()
|
H A D | pipe09.c | 80 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() 107 tst_resm(TWARN, "pipefd[0] close failed, " in main() 113 if (write(pipefd[1], "A", 1) != 1) { in main() 133 if (close(pipefd[0]) != 0) { in main() 134 perror("pipefd[0] close failed"); in main() 139 if (write(pipefd[1], "B", 1) != 1) { in main() 155 if (close(pipefd[1]) != 0) { in main() 157 "pipefd[ in main() [all...] |
/third_party/musl/libc-test/src/functionalext/supplement/unistd/unistd_gtest/ |
H A D | unistd_Exit_test.cpp | 22 int pipefd[2]; in HWTEST_F() local 23 ASSERT_NE(-1, pipe(pipefd)); in HWTEST_F() 26 close(pipefd[0]); in HWTEST_F() 27 write(pipefd[1], "before exit", sizeof("before exit")); in HWTEST_F() 28 close(pipefd[1]); in HWTEST_F() 30 write(pipefd[1], "after exit", sizeof("after exit")); in HWTEST_F() 32 close(pipefd[1]); in HWTEST_F() 34 read(pipefd[0], buffer, sizeof(buffer)); in HWTEST_F() 35 close(pipefd[0]); in HWTEST_F()
|
/third_party/ltp/testcases/kernel/syscalls/sendmsg/ |
H A D | sendmsg02.c | 62 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) < in reproduce() [all...] |
/third_party/pulseaudio/src/tests/ |
H A D | srbchannel-test.c | 85 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[ in START_TEST() [all...] |
/third_party/ninja/src/ |
H A D | browse.cc | 31 int pipefd[2]; in RunBrowsePython() local 32 if (pipe(pipefd) < 0) { in RunBrowsePython() 44 close(pipefd[1]); in RunBrowsePython() 46 if (dup2(pipefd[0], 0) < 0) { in RunBrowsePython() 71 close(pipefd[0]); in RunBrowsePython() 79 ssize_t len = write(pipefd[1], kBrowsePy, kBrowsePyLength); in RunBrowsePython() 82 close(pipefd[1]); in RunBrowsePython()
|
/third_party/ltp/testcases/kernel/syscalls/setrlimit/ |
H A D | setrlimit01.c | 126 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/ |
H A D | async.c | 204 int pipefd[2]; in uv__async_start() local 215 pipefd[0] = err; in uv__async_start() 216 pipefd[1] = -1; in uv__async_start() 218 fdsan_exchange_owner_tag(pipefd[0], 0, uv__get_addr_tag((void *)&loop->async_io_watcher)); in uv__async_start() 221 err = uv__make_pipe(pipefd, UV_NONBLOCK_PIPE); in uv__async_start() 226 uv__io_init(&loop->async_io_watcher, uv__async_io, pipefd[0]); in uv__async_start() 228 loop->async_wfd = pipefd[1]; in uv__async_start() 229 UV_LOGI("open:%{public}zu, pipefd[0]:%{public}d", (size_t)loop, pipefd[0]); in uv__async_start()
|
/third_party/ltp/testcases/kernel/syscalls/write/ |
H A D | write05.c | 35 static int pipefd[2]; variable 45 {&pipefd[1], &buf, sizeof(buf), EPIPE}, 77 SAFE_PIPE(pipefd); in setup() 78 SAFE_CLOSE(pipefd[0]); in setup()
|
/third_party/node/deps/uv/src/unix/ |
H A D | async.c | 203 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/libuv/test/ |
H A D | runner-unix.c | 90 int pipefd[2]; in process_start() local 123 if (pipe(pipefd)) { in process_start() 128 snprintf(fdstr, sizeof(fdstr), "%d", pipefd[1]); in process_start() 152 closefd(pipefd[0]); in process_start() 170 closefd(pipefd[1]); in process_start() 174 rc = read(pipefd[0], &n, 1); in process_start() 177 closefd(pipefd[0]); in process_start()
|
/third_party/libunwind/libunwind/src/aarch64/ |
H A D | Ginit.c | 96 do_pipe2 (int pipefd[2]) in do_pipe2() argument 98 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2() 115 do_pipe2 (int pipefd[2]) in do_pipe2() argument 117 pipe (pipefd); in do_pipe2() 118 set_pipe_flags(pipefd[0]); in do_pipe2() 119 set_pipe_flags(pipefd[1]); in do_pipe2()
|
/third_party/libunwind/libunwind/src/arm/ |
H A D | Ginit.c | 86 do_pipe2 (int pipefd[2]) in do_pipe2() argument 88 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2() 105 do_pipe2 (int pipefd[2]) in do_pipe2() argument 107 pipe (pipefd); in do_pipe2() 108 set_pipe_flags(pipefd[0]); in do_pipe2() 109 set_pipe_flags(pipefd[1]); in do_pipe2()
|
/third_party/libunwind/libunwind/src/riscv/ |
H A D | Ginit.c | 107 do_pipe2 (int pipefd[2]) in do_pipe2() argument 109 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2() 126 do_pipe2 (int pipefd[2]) in do_pipe2() argument 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/libunwind/src/x86_64/ |
H A D | Ginit.c | 83 do_pipe2 (int pipefd[2]) in do_pipe2() argument 85 pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); in do_pipe2() 102 do_pipe2 (int pipefd[2]) in do_pipe2() argument 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/ltp/testcases/kernel/logging/kmsg/ |
H A D | kmsg01.c | 176 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/ltp/testcases/kernel/watchqueue/ |
H A D | common.h | 97 int pipefd[2]; in wqueue_watch() local 100 TEST(pipe2(pipefd, O_NOTIFICATION_PIPE)); in wqueue_watch() 114 fd = pipefd[0]; in wqueue_watch()
|
/third_party/nghttp2/examples/ |
H A D | libevent-server.c | 445 int pipefd[2]; in error_reply() local 448 rv = pipe(pipefd); in error_reply() 461 writelen = write(pipefd[1], ERROR_HTML, sizeof(ERROR_HTML) - 1); in error_reply() 462 close(pipefd[1]); in error_reply() 465 close(pipefd[0]); in error_reply() 469 stream_data->fd = pipefd[0]; in error_reply() 472 pipefd[0]) != 0) { in error_reply() 473 close(pipefd[0]); in error_reply()
|
/third_party/toybox/toys/posix/ |
H A D | tar.c | 853 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() 927 int pipefd[2] = {-1, TT.fd}; tar_main() local [all...] |
/third_party/libevdev/test/ |
H A D | test-libevdev-events.c | 117 int pipefd[2]; in START_TEST() local 144 rc = pipe2(pipefd, O_NONBLOCK); in START_TEST() 147 libevdev_change_fd(dev, pipefd[0]); in START_TEST() 151 rc = write(pipefd[1], &ev, sizeof(ev)); in START_TEST() 164 close(pipefd[0]); in START_TEST() 165 close(pipefd[1]); in START_TEST() 1633 int pipefd[2]; in START_TEST() local 1640 rc = pipe2(pipefd, O_NONBLOCK); in START_TEST() 1642 libevdev_change_fd(dev, pipefd[0]); in START_TEST() 1651 rc = write(pipefd[ in START_TEST() 1760 int pipefd[2]; START_TEST() local [all...] |
/third_party/libinput/test/ |
H A D | litest.c | 122 int pipefd[2]; in litest_backtrace() local 129 if (pipe(pipefd) == -1) in litest_backtrace() 138 close(pipefd[0]); in litest_backtrace() 139 dup2(pipefd[1], STDOUT_FILENO); in litest_backtrace() 151 close(pipefd[1]); in litest_backtrace() 160 while ((nread = read(pipefd[0], buf, sizeof(buf) - 1)) > 0) { in litest_backtrace() 166 close(pipefd[0]); in litest_backtrace() 1142 int pipefd[2]; in litest_fork_subtests() local 1144 rc = pipe2(pipefd, O_NONBLOCK); in litest_fork_subtests() 1149 close(pipefd[ in litest_fork_subtests() [all...] |
/third_party/pulseaudio/src/pulsecore/ |
H A D | core-util.h | 302 int pa_pipe_cloexec(int pipefd[2]);
|
H A D | core-util.c | 3659 int pa_pipe_cloexec(int pipefd[2]) { in pa_pipe_cloexec() argument 3663 if ((r = pipe2(pipefd, O_CLOEXEC)) >= 0) in pa_pipe_cloexec() 3681 if ((r = pipe(pipefd)) >= 0) in pa_pipe_cloexec() 3698 pa_make_fd_cloexec(pipefd[0]); in pa_pipe_cloexec() 3699 pa_make_fd_cloexec(pipefd[1]); in pa_pipe_cloexec()
|
/third_party/libfuse/lib/ |
H A D | fuse_lowlevel.c | 630 static int grow_pipe_to_max(int pipefd) argument 653 res = fcntl(pipefd, F_SETPIPE_SZ, max);
|