Home
last modified time | relevance | path

Searched refs:fds (Results 1 – 25 of 546) sorted by relevance

12345678910>>...22

/external/strace/tests-m32/
Dxselect.c88 int fds[2]; in main() local
89 if (pipe(fds)) in main()
93 const int nfds = fds[1] + 1; in main()
143 *l_rs = (1UL << fds[0]) | (1UL << fds[1]); in main()
147 TEST_SYSCALL_STR, i, fds[0], fds[1], in main()
148 fds[0], fds[1], fds[0], fds[1]); in main()
150 *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | in main()
157 fds[0], fds[1], PATH_TRACING_FD, in main()
158 fds[0], fds[1], PATH_TRACING_FD, in main()
159 fds[0], fds[1], PATH_TRACING_FD); in main()
[all …]
Dpselect6.c53 int fds[2]; in main() local
69 if (pipe(fds)) in main()
75 FD_SET(fds[0], set[0]); in main()
76 FD_SET(fds[1], set[0]); in main()
77 FD_SET(fds[0], set[1]); in main()
78 FD_SET(fds[1], set[1]); in main()
81 int rc = pselect(fds[1] + 1, set[0], set[1], set[2], NULL, NULL); in main()
87 fds[1] + 1, fds[0], fds[1], in main()
88 fds[0], fds[1], in main()
89 NSIG_BYTES, fds[1]); in main()
[all …]
Dreadv.c43 int fds[2]; in main() local
44 pipe_maxfd(fds); in main()
61 rc = writev(fds[1], efault, 42); in main()
63 fds[1], efault, rc, errno2name()); in main()
65 rc = readv(fds[0], efault, 42); in main()
67 fds[0], efault, rc, errno2name()); in main()
89 fds[1], (long) writev(fds[1], w_iov, 0)); in main()
91 rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); in main()
94 fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), in main()
100 assert(writev(fds[1], w_iov, ARRAY_SIZE(w_iov_)) == (int) w_len); in main()
[all …]
/external/strace/tests-mx32/
Dxselect.c88 int fds[2]; in main() local
89 if (pipe(fds)) in main()
93 const int nfds = fds[1] + 1; in main()
143 *l_rs = (1UL << fds[0]) | (1UL << fds[1]); in main()
147 TEST_SYSCALL_STR, i, fds[0], fds[1], in main()
148 fds[0], fds[1], fds[0], fds[1]); in main()
150 *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | in main()
157 fds[0], fds[1], PATH_TRACING_FD, in main()
158 fds[0], fds[1], PATH_TRACING_FD, in main()
159 fds[0], fds[1], PATH_TRACING_FD); in main()
[all …]
Dpselect6.c53 int fds[2]; in main() local
69 if (pipe(fds)) in main()
75 FD_SET(fds[0], set[0]); in main()
76 FD_SET(fds[1], set[0]); in main()
77 FD_SET(fds[0], set[1]); in main()
78 FD_SET(fds[1], set[1]); in main()
81 int rc = pselect(fds[1] + 1, set[0], set[1], set[2], NULL, NULL); in main()
87 fds[1] + 1, fds[0], fds[1], in main()
88 fds[0], fds[1], in main()
89 NSIG_BYTES, fds[1]); in main()
[all …]
Dreadv.c43 int fds[2]; in main() local
44 pipe_maxfd(fds); in main()
61 rc = writev(fds[1], efault, 42); in main()
63 fds[1], efault, rc, errno2name()); in main()
65 rc = readv(fds[0], efault, 42); in main()
67 fds[0], efault, rc, errno2name()); in main()
89 fds[1], (long) writev(fds[1], w_iov, 0)); in main()
91 rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); in main()
94 fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), in main()
100 assert(writev(fds[1], w_iov, ARRAY_SIZE(w_iov_)) == (int) w_len); in main()
[all …]
/external/strace/tests/
Dxselect.c88 int fds[2]; in main() local
89 if (pipe(fds)) in main()
93 const int nfds = fds[1] + 1; in main()
143 *l_rs = (1UL << fds[0]) | (1UL << fds[1]); in main()
147 TEST_SYSCALL_STR, i, fds[0], fds[1], in main()
148 fds[0], fds[1], fds[0], fds[1]); in main()
150 *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | in main()
157 fds[0], fds[1], PATH_TRACING_FD, in main()
158 fds[0], fds[1], PATH_TRACING_FD, in main()
159 fds[0], fds[1], PATH_TRACING_FD); in main()
[all …]
Dpselect6.c53 int fds[2]; in main() local
69 if (pipe(fds)) in main()
75 FD_SET(fds[0], set[0]); in main()
76 FD_SET(fds[1], set[0]); in main()
77 FD_SET(fds[0], set[1]); in main()
78 FD_SET(fds[1], set[1]); in main()
81 int rc = pselect(fds[1] + 1, set[0], set[1], set[2], NULL, NULL); in main()
87 fds[1] + 1, fds[0], fds[1], in main()
88 fds[0], fds[1], in main()
89 NSIG_BYTES, fds[1]); in main()
[all …]
Dreadv.c43 int fds[2]; in main() local
44 pipe_maxfd(fds); in main()
61 rc = writev(fds[1], efault, 42); in main()
63 fds[1], efault, rc, errno2name()); in main()
65 rc = readv(fds[0], efault, 42); in main()
67 fds[0], efault, rc, errno2name()); in main()
89 fds[1], (long) writev(fds[1], w_iov, 0)); in main()
91 rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); in main()
94 fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), in main()
100 assert(writev(fds[1], w_iov, ARRAY_SIZE(w_iov_)) == (int) w_len); in main()
[all …]
/external/rust/crates/libc/src/unix/solarish/
Dcompat.rs42 unsafe fn bail(fdm: ::c_int, fds: ::c_int) -> ::c_int { in bail()
44 if fds >= 0 { in bail()
45 ::close(fds); in bail()
81 let fds = ::open(subordpath, O_RDWR | O_NOCTTY); in openpty() localVariable
82 if fds < 0 { in openpty()
87 let setup = ::ioctl(fds, I_FIND, LDTERM.as_ptr()); in openpty()
89 return bail(fdm, fds); in openpty()
93 if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 { in openpty()
94 return bail(fdm, fds); in openpty()
99 if !termp.is_null() && ::tcsetattr(fds, TCSAFLUSH, termp) != 0 { in openpty()
[all …]
/external/libchrome/base/posix/
Dunix_domain_socket_unittest.cc31 void CreateSocketPair(int fds[2]) { in CreateSocketPair()
38 ASSERT_EQ(0, socketpair(AF_UNIX, flags, 0, fds)); in CreateSocketPair()
43 ASSERT_EQ(0, setsockopt(fds[0], SOL_SOCKET, SO_NOSIGPIPE, &nosigpipe, in CreateSocketPair()
45 ASSERT_EQ(0, setsockopt(fds[1], SOL_SOCKET, SO_NOSIGPIPE, &nosigpipe, in CreateSocketPair()
53 int fds[2]; in TEST() local
54 ASSERT_NO_FATAL_FAILURE(CreateSocketPair(fds)); in TEST()
55 ScopedFD scoped_fd0(fds[0]); in TEST()
56 ScopedFD scoped_fd1(fds[1]); in TEST()
61 FROM_HERE, BindOnce(IgnoreResult(&UnixDomainSocket::SendRecvMsg), fds[1], in TEST()
69 UnixDomainSocket::RecvMsg(fds[0], buffer, sizeof(buffer), &message_fds)); in TEST()
[all …]
/external/google-breakpad/src/client/linux/minidump_writer/
Dminidump_writer_unittest.cc65 int fds[2]; in TEST() local
66 ASSERT_NE(-1, pipe(fds)); in TEST()
70 close(fds[1]); in TEST()
72 IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b)))); in TEST()
73 close(fds[0]); in TEST()
76 close(fds[0]); in TEST()
90 close(fds[1]); in TEST()
95 int fds[2]; in TEST() local
96 ASSERT_NE(-1, pipe(fds)); in TEST()
100 close(fds[1]); in TEST()
[all …]
/external/linux-kselftest/tools/testing/selftests/net/
Dpsock_fanout.c221 static int sock_fanout_read(int fds[], char *rings[], const int expect[]) in sock_fanout_read() argument
225 ret[0] = sock_fanout_read_ring(fds[0], rings[0]); in sock_fanout_read()
226 ret[1] = sock_fanout_read_ring(fds[1], rings[1]); in sock_fanout_read()
255 int fds[2]; in test_control_group() local
259 fds[0] = sock_fanout_open(PACKET_FANOUT_HASH, 0); in test_control_group()
260 if (fds[0] == -1) { in test_control_group()
278 fds[1] = sock_fanout_open(PACKET_FANOUT_HASH, 0); in test_control_group()
279 if (fds[1] == -1) { in test_control_group()
283 if (close(fds[1]) || close(fds[0])) { in test_control_group()
292 int fds[3]; in test_unique_fanout_group_ids() local
[all …]
Dpsock_lib.h75 static __maybe_unused void pair_udp_open(int fds[], uint16_t port) in pair_udp_open() argument
79 fds[0] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open()
80 fds[1] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open()
81 if (fds[0] == -1 || fds[1] == -1) { in pair_udp_open()
97 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) { in pair_udp_open()
101 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) { in pair_udp_open()
105 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) { in pair_udp_open()
111 static __maybe_unused void pair_udp_send_char(int fds[], int num, char payload) in pair_udp_send_char() argument
118 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char()
122 if (read(fds[1], rbuf, sizeof(rbuf)) != sizeof(rbuf)) { in pair_udp_send_char()
[all …]
/external/ltp/testcases/kernel/syscalls/epoll_wait/
Depoll_wait01.c21 static int write_size, epfd, fds[2]; variable
28 {.fd = fds[1], .events = POLLOUT}, in get_writesize()
34 write_size += SAFE_WRITE(0, fds[1], buf, sizeof(buf)); in get_writesize()
42 SAFE_READ(1, fds[0], read_buf, sizeof(read_buf)); in get_writesize()
56 SAFE_PIPE(fds); in setup()
58 epevs[0].data.fd = fds[0]; in setup()
59 epevs[1].data.fd = fds[1]; in setup()
67 if (epoll_ctl(epfd, EPOLL_CTL_ADD, fds[0], &epevs[0]) || in setup()
68 epoll_ctl(epfd, EPOLL_CTL_ADD, fds[1], &epevs[1])) { in setup()
113 if (ret_evs.data.fd != fds[1]) { in verify_epollout()
[all …]
/external/libcups/scheduler/
Dfile.c148 cupsdClosePipe(int *fds) /* I - Pipe file descriptors (2) */ in cupsdClosePipe() argument
154 if (fds[0] >= 0) in cupsdClosePipe()
156 close(fds[0]); in cupsdClosePipe()
157 fds[0] = -1; in cupsdClosePipe()
160 if (fds[1] >= 0) in cupsdClosePipe()
162 close(fds[1]); in cupsdClosePipe()
163 fds[1] = -1; in cupsdClosePipe()
243 cupsdOpenPipe(int *fds) /* O - Pipe file descriptors (2) */ in cupsdOpenPipe() argument
249 if (pipe(fds)) in cupsdOpenPipe()
251 fds[0] = -1; in cupsdOpenPipe()
[all …]
Dutil.c239 fds[2]; /* Pipe file descriptors */ in cupsdPipeCommand() local
246 if (pipe(fds)) in cupsdPipeCommand()
256 if (fcntl(fds[0], F_SETFD, fcntl(fds[0], F_GETFD) | FD_CLOEXEC)) in cupsdPipeCommand()
258 close(fds[0]); in cupsdPipeCommand()
259 close(fds[1]); in cupsdPipeCommand()
266 if (fcntl(fds[1], F_SETFD, fcntl(fds[1], F_GETFD) | FD_CLOEXEC)) in cupsdPipeCommand()
268 close(fds[0]); in cupsdPipeCommand()
269 close(fds[1]); in cupsdPipeCommand()
287 close(fds[0]); in cupsdPipeCommand()
288 close(fds[1]); in cupsdPipeCommand()
[all …]
/external/ltp/testcases/kernel/syscalls/unlinkat/
Dunlinkat01.c61 static int fds[TEST_CASES]; variable
87 TEST(myunlinkat(fds[i], filenames[i], flags[i])); in main()
118 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); in setup()
119 fds[1] = fds[4] = fds[6] = fds[0]; in setup()
124 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); in setup()
126 fds[3] = 100; in setup()
127 fds[5] = AT_FDCWD; in setup()
139 if (fds[0] > 0) in cleanup()
140 close(fds[0]); in cleanup()
141 if (fds[2] > 0) in cleanup()
[all …]
/external/google-breakpad/src/client/mac/tests/
Dexception_handler_test.cc106 int fds[2]; in InProcessCrash() local
107 ASSERT_EQ(0, pipe(fds)); in InProcessCrash()
112 close(fds[0]); in InProcessCrash()
113 ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL); in InProcessCrash()
122 close(fds[1]); in InProcessCrash()
124 ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file)); in InProcessCrash()
245 int fds[2]; in TEST_F() local
246 ASSERT_EQ(0, pipe(fds)); in TEST_F()
252 close(fds[1]); in TEST_F()
265 read(fds[0], &data, 1); in TEST_F()
[all …]
/external/ltp/testcases/kernel/syscalls/fchmodat/
Dfchmodat01.c61 int fds[TEST_CASES]; variable
90 TEST(myfchmodat(fds[i], filenames[i], 0600)); in main()
127 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); in setup()
128 fds[1] = fds[4] = fds[0]; in setup()
133 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); in setup()
134 fds[3] = 100; in setup()
135 fds[5] = AT_FDCWD; in setup()
146 if (fds[0] > 0) in cleanup()
147 close(fds[0]); in cleanup()
148 if (fds[2] > 0) in cleanup()
[all …]
/external/ltp/testcases/kernel/syscalls/faccessat/
Dfaccessat01.c61 static int fds[TEST_CASES]; variable
90 TEST(myfaccessat(fds[i], filenames[i], R_OK)); in main()
129 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); in setup()
130 fds[1] = fds[4] = fds[0]; in setup()
135 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); in setup()
137 fds[3] = 100; in setup()
138 fds[5] = AT_FDCWD; in setup()
149 if (fds[0] > 0) in cleanup()
150 close(fds[0]); in cleanup()
151 if (fds[2] > 0) in cleanup()
[all …]
/external/ltp/testcases/kernel/syscalls/futimesat/
Dfutimesat01.c55 static int fds[TEST_CASES]; variable
82 TEST(myfutimesat(fds[i], filenames[i], times)); in main()
111 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); in setup()
112 fds[1] = fds[0]; in setup()
117 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); in setup()
119 fds[3] = 100; in setup()
120 fds[4] = AT_FDCWD; in setup()
130 if (fds[0] > 0) in cleanup()
131 close(fds[0]); in cleanup()
132 if (fds[2] > 0) in cleanup()
[all …]
/external/ltp/testcases/kernel/syscalls/fstatat/
Dfstatat01.c56 static int fds[TEST_CASES]; variable
100 TEST(fstatat(fds[i], filenames[i], &statbuf, flags[i])); in main()
128 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY); in setup()
129 fds[1] = fds[4] = fds[0]; in setup()
134 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600); in setup()
136 fds[3] = 100; in setup()
137 fds[5] = AT_FDCWD; in setup()
148 if (fds[0] > 0) in cleanup()
149 close(fds[0]); in cleanup()
150 if (fds[2] > 0) in cleanup()
[all …]
/external/strace/
Dpoll.c39 const struct pollfd *fds = elem_buf; in print_pollfd() local
42 printfd(tcp, fds->fd); in print_pollfd()
43 if (fds->fd >= 0) { in print_pollfd()
45 printflags(pollflags, (unsigned short) fds->events, "POLL???"); in print_pollfd()
57 struct pollfd fds; in decode_poll_entering() local
59 print_array(tcp, addr, nfds, &fds, sizeof(fds), in decode_poll_entering()
67 struct pollfd fds; in decode_poll_exiting() local
69 const unsigned long size = sizeof(fds) * nfds; in decode_poll_exiting()
89 size / sizeof(fds) != nfds || end < start) in decode_poll_exiting()
94 for (printed = 0, cur = start; cur < end; cur += sizeof(fds)) { in decode_poll_exiting()
[all …]
/external/ltp/testcases/kernel/syscalls/socketpair/
Dsocketpair01.c22 static int fds[2]; variable
33 {0, SOCK_STREAM, 0, fds, -1, EAFNOSUPPORT, "invalid domain"},
34 {PF_INET, 75, 0, fds, -1, EINVAL, "invalid type"},
35 {PF_UNIX, SOCK_DGRAM, 0, fds, 0, 0, "UNIX domain dgram"},
36 {PF_INET, SOCK_RAW, 0, fds, -1, EPROTONOSUPPORT, "raw open as non-root"},
41 {PF_INET, SOCK_DGRAM, 17, fds, -1, EOPNOTSUPP, "UDP socket"},
42 {PF_INET, SOCK_DGRAM, 6, fds, -1, EPROTONOSUPPORT, "TCP dgram"},
43 {PF_INET, SOCK_STREAM, 6, fds, -1, EOPNOTSUPP, "TCP socket"},
44 {PF_INET, SOCK_STREAM, 1, fds, -1, EPROTONOSUPPORT, "ICMP stream"}
54 SAFE_CLOSE(fds[0]); in verify_socketpair()
[all …]

12345678910>>...22