Searched refs:fds (Results 1 - 25 of 36) sorted by relevance

12

/system/core/adb/
H A Dsysdeps_test.cpp29 int fds[2]; local
30 ASSERT_EQ(0, adb_socketpair(fds)) << strerror(errno);
31 ASSERT_TRUE(WriteFdExactly(fds[0], "foo", 4));
32 ASSERT_TRUE(WriteFdExactly(fds[1], "bar", 4));
35 ASSERT_TRUE(ReadFdExactly(fds[1], buf, 4));
37 ASSERT_TRUE(ReadFdExactly(fds[0], buf, 4));
39 ASSERT_EQ(0, adb_close(fds[0]));
40 ASSERT_EQ(0, adb_close(fds[1]));
44 std::vector<int> fds; local
48 fds
65 int fds[2]; member in class:sysdeps_poll
[all...]
H A Dframebuffer_service.cpp65 int fds[2]; local
68 if (pipe2(fds, O_CLOEXEC) < 0) goto pipefail;
74 dup2(fds[1], STDOUT_FILENO);
75 adb_close(fds[0]);
76 adb_close(fds[1]);
83 adb_close(fds[1]);
84 fd_screencap = fds[0];
183 adb_close(fds[0]);
H A Dshell_service_protocol_test.cpp43 int fds[2]; local
44 ASSERT_EQ(0, adb_socketpair(fds));
45 read_fd_ = fds[0];
46 write_fd_ = fds[1];
H A Dfdevent_test.cpp93 int fds[2]; local
94 ASSERT_EQ(0, adb_socketpair(fds));
95 read_fds.push_back(fds[0]);
96 write_fds.push_back(fds[1]);
H A Djdwp_service.cpp335 int fds[2]; local
337 if (adb_socketpair(fds) < 0) {
341 D("socketpair: (%d,%d)", fds[0], fds[1]);
343 proc->out_fds.emplace_back(fds[1]);
348 return fds[0];
/system/extras/tests/pagingtest/
H A Dthrashing_test.c15 int fds[4] = {-1, -1, -1, -1}; local
34 filesize = num_pages * pagesize / (ARRAY_SIZE(fds) - 1);
36 for (size_t i = 0; i < ARRAY_SIZE(fds); i++) {
37 fds[i] = create_tmp_file(tmpnames[i], filesize);
38 if (fds[i] < 0) {
43 for (size_t i = 0; i < ARRAY_SIZE(fds); i++) {
44 bufs[i] = mmap(NULL, filesize, PROT_READ, MAP_PRIVATE, fds[i], 0);
52 posix_fadvise(fds[i], 0, filesize, POSIX_FADV_RANDOM);
60 for (size_t j = 0; j < ARRAY_SIZE(fds); j++) {
73 (filesize * ARRAY_SIZE(fds) * test_run
[all...]
/system/core/libutils/tests/
H A DTestHelpers.h30 int fds[2]; local
31 ::pipe(fds);
33 receiveFd = fds[0];
34 sendFd = fds[1];
/system/media/audio_utils/tests/
H A Dgetch.c38 fd_set fds; local
39 FD_ZERO(&fds); // not in original posting to stackoverflow
40 FD_SET(0, &fds);
41 return select(1, &fds, NULL, NULL, &tv);
/system/extras/tests/storage/
H A Dopentest.c30 int *fds; local
64 fds = malloc(nfiles * sizeof(int));
65 if (fds == 0) {
66 fprintf(stderr, "Unable to malloc array of %d fds\n", nfiles);
84 fds[i] = open(name, O_WRONLY | O_CREAT, 0666);
85 if (fds[i] < 0) {
/system/connectivity/wificond/tests/
H A Dlooper_backed_event_loop_unittest.cpp40 int fds[2]; local
41 ::pipe(fds);
43 receive_fd = android::base::unique_fd(fds[0]);
44 send_fd = android::base::unique_fd(fds[1]);
H A Dshell_utils.cpp60 int fds[2]; local
61 if (pipe2(fds, O_NONBLOCK) != 0) {
64 unique_fd read_fd(fds[0]);
65 unique_fd write_fd(fds[1]);
/system/tools/aidl/tests/
H A Daidl_test_client_file_descriptors.cpp94 int fds[2]; local
97 if (pipe(fds)) {
102 read_side->reset(fds[0]);
103 write_side->reset(fds[1]);
/system/bt/hci/src/
H A Dhci_layer_linux.cc153 fd_set fds; local
154 FD_ZERO(&fds);
155 FD_SET(ctrl_fd, &fds);
156 FD_SET(fd, &fds);
157 int res = select(std::max(fd, ctrl_fd) + 1, &fds, NULL, NULL, NULL);
160 if (FD_ISSET(ctrl_fd, &fds)) {
283 struct pollfd fds[1]; local
307 fds[0].fd = fd;
308 fds[0].events = POLLIN;
325 OSI_NO_INTR(n = poll(fds,
[all...]
/system/core/libappfuse/
H A DFuseBuffer.cc140 base::unique_fd fds[2]; local
147 fds[0].reset(raw_fds[0]);
148 fds[1].reset(raw_fds[1]);
152 if (setsockopt(fds[0], SOL_SOCKET, SO_SNDBUFFORCE, &kMaxMessageSize, sizeof(int)) != 0 ||
153 setsockopt(fds[1], SOL_SOCKET, SO_SNDBUFFORCE, &kMaxMessageSize, sizeof(int)) != 0) {
158 (*result)[0] = std::move(fds[0]);
159 (*result)[1] = std::move(fds[1]);
/system/netd/server/dns/
H A DDnsTlsTransport.cpp54 fd_set fds; local
55 FD_ZERO(&fds);
56 FD_SET(fd, &fds);
57 const int ret = TEMP_FAILURE_RETRY(select(fd + 1, &fds, nullptr, nullptr, nullptr));
65 fd_set fds; local
66 FD_ZERO(&fds);
67 FD_SET(fd, &fds);
68 const int ret = TEMP_FAILURE_RETRY(select(fd + 1, nullptr, &fds, nullptr, nullptr));
/system/core/include/utils/
H A DFlattenable.h100 // file descriptors are written in the fds[] array but ownership is
103 inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const;
108 // unflattened file descriptors are found in the fds[] array and
112 inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count);
125 void*& buffer, size_t& size, int*& fds, size_t& count) const {
126 return static_cast<T const*>(this)->T::flatten(buffer, size, fds, count);
130 void const*& buffer, size_t& size, int const*& fds, size_t& count) {
131 return static_cast<T*>(this)->T::unflatten(buffer, size, fds, count);
124 flatten( void*& buffer, size_t& size, int*& fds, size_t& count) const argument
129 unflatten( void const*& buffer, size_t& size, int const*& fds, size_t& count) argument
/system/core/libutils/include/utils/
H A DFlattenable.h100 // file descriptors are written in the fds[] array but ownership is
103 inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const;
108 // unflattened file descriptors are found in the fds[] array and
112 inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count);
125 void*& buffer, size_t& size, int*& fds, size_t& count) const {
126 return static_cast<T const*>(this)->T::flatten(buffer, size, fds, count);
130 void const*& buffer, size_t& size, int const*& fds, size_t& count) {
131 return static_cast<T*>(this)->T::unflatten(buffer, size, fds, count);
124 flatten( void*& buffer, size_t& size, int*& fds, size_t& count) const argument
129 unflatten( void const*& buffer, size_t& size, int const*& fds, size_t& count) argument
/system/bt/vendor_libs/linux/interface/
H A Dbluetooth_hci.cc118 struct pollfd fds[1]; local
139 fds[0].fd = fd;
140 fds[0].events = POLLIN;
157 WRITE_NO_INTR(n = poll(fds, 1, MGMT_EV_POLL_TIMEOUT));
168 if (fds[0].revents & POLLIN) {
/system/core/libappfuse/tests/
H A DFuseBufferTest.cc196 base::unique_fd fds[2]; local
197 SetupMessageSockets(&fds);
199 std::thread thread([&fds] {
202 ASSERT_TRUE(request.Read(fds[1]));
208 ASSERT_TRUE(request.Write(fds[0]));
/system/core/libion/tests/
H A Dallocate_test.cpp98 int fds[16]; local
112 fds[i] = map_fd;
116 ASSERT_EQ(0, close(fds[i]));
/system/core/logcat/
H A Dlogcat.cpp94 int fds[2]; // From popen call member in struct:android_logcat_context_internal
133 context->fds[0] = -1;
134 context->fds[1] = -1;
181 if (context->fds[1] == fileno(context->output)) {
182 context->fds[1] = -1;
190 if (context->fds[1] == context->output_fd) {
191 context->fds[1] = -1;
217 if (context->fds[1] == fileno(context->error)) {
218 context->fds[1] = -1;
227 if (context->fds[
[all...]
/system/core/adf/libadfhwc/
H A Dadfhwc.cpp292 pollfd fds[dev->intf_fds.size()]; local
294 fds[i].fd = dev->intf_fds[i];
295 fds[i].events = POLLIN | POLLPRI;
299 if (TEMP_FAILURE_RETRY(poll(fds, dev->intf_fds.size(), -1)) < 0) {
305 if (fds[i].revents & (POLLIN | POLLPRI))
/system/core/libsync/
H A Dsync.c103 struct pollfd fds; local
111 fds.fd = fd;
112 fds.events = POLLIN;
115 ret = poll(&fds, 1, timeout);
117 if (fds.revents & (POLLERR | POLLNVAL)) {
/system/extras/verity/fec/
H A Dimage.cpp94 static void file_image_load(const std::vector<int>& fds, image *ctx) argument
99 for (auto fd : fds) {
140 for (auto fd : fds) {
156 std::vector<int> fds; local
165 fds.push_back(fd);
168 file_image_load(fds, ctx);
/system/netd/server/
H A DNetlinkListener.cpp109 const std::array<Fd, 2> fds{{{mEvent}, {mSock}}};
113 ASSIGN_OR_RETURN(auto revents, sys.ppoll(fds, events, timeout));

Completed in 720 milliseconds

12