Searched defs:fds (Results 1 - 25 of 31) sorted by relevance

12

/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/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/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/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 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 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 Dfdevent_test.cpp94 int fds[2]; local
95 ASSERT_EQ(0, adb_socketpair(fds));
96 read_fds.push_back(fds[0]);
97 write_fds.push_back(fds[1]);
/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/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/libutils/tests/
H A DTestHelpers.h30 int fds[2]; local
31 ::pipe(fds);
33 receiveFd = fds[0];
34 sendFd = fds[1];
/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/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/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_SNDBUF, &kMaxMessageSize, sizeof(int)) != 0 ||
153 setsockopt(fds[1], SOL_SOCKET, SO_SNDBUF, &kMaxMessageSize, sizeof(int)) != 0) {
158 (*result)[0] = std::move(fds[0]);
159 (*result)[1] = std::move(fds[1]);
/system/netd/libnetdutils/include/netdutils/
H A DSyscalls.h62 virtual StatusOr<int> ppoll(pollfd* fds, nfds_t nfds, double timeout) const = 0;
141 StatusOr<std::array<uint16_t, size>> ppoll(const std::array<Fd, size>& fds, uint16_t events, argument
145 tmp[i].fd = fds[i].get();
/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/vendor_libs/test_vendor_lib/src/
H A Dasync_manager.cc225 std::vector<decltype(watched_shared_fds_)::value_type> fds; local
230 fds.push_back(fdc);
234 for (auto& p : fds) {
/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.cpp93 static void file_image_load(const std::vector<int>& fds, image *ctx) argument
98 for (auto fd : fds) {
139 for (auto fd : fds) {
155 std::vector<int> fds; local
164 fds.push_back(fd);
167 file_image_load(fds, ctx);
/system/netd/server/dns/
H A DDnsTlsSocket.cpp54 struct pollfd fds = { .fd = fd, .events = POLLIN }; local
55 const int ret = TEMP_FAILURE_RETRY(poll(&fds, 1, -1));
60 struct pollfd fds = { .fd = fd, .events = POLLOUT }; local
61 const int ret = TEMP_FAILURE_RETRY(poll(&fds, 1, -1));
349 // poll() ignores negative fds
350 struct pollfd fds[2] = { { .fd = -1 }, { .fd = -1 } }; local
354 fds[SSLFD].fd = mSslFd.get();
355 fds[SSLFD].events = POLLIN;
360 fds[SSLFD].events |= POLLOUT;
362 fds[IPCF
[all...]
/system/netd/tests/dns_responder/
H A Ddns_tls_frontend.cpp264 struct pollfd fds[1] = {{ .fd = socket_, .events = POLLIN }}; local
267 int poll_code = poll(fds, 1, 10 /* ms */);
/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/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) {

Completed in 457 milliseconds

12