Home
last modified time | relevance | path

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

1234

/system/core/adb/
Dsysdeps_test.cpp44 int fds[2]; in TEST() local
45 ASSERT_EQ(0, adb_socketpair(fds)) << strerror(errno); in TEST()
46 ASSERT_TRUE(WriteFdExactly(fds[0], "foo", 4)); in TEST()
47 ASSERT_TRUE(WriteFdExactly(fds[1], "bar", 4)); in TEST()
50 ASSERT_TRUE(ReadFdExactly(fds[1], buf, 4)); in TEST()
52 ASSERT_TRUE(ReadFdExactly(fds[0], buf, 4)); in TEST()
54 ASSERT_EQ(0, adb_close(fds[0])); in TEST()
55 ASSERT_EQ(0, adb_close(fds[1])); in TEST()
59 std::vector<int> fds; in TEST() local
63 fds.push_back(socketpair[0]); in TEST()
[all …]
Dtransport_benchmark.cpp56 int fds[2]; in BM_Connection_Unidirectional() local
57 if (adb_socketpair(fds) != 0) { in BM_Connection_Unidirectional()
61 auto client = MakeConnection<ConnectionType>(unique_fd(fds[0])); in BM_Connection_Unidirectional()
62 auto server = MakeConnection<ConnectionType>(unique_fd(fds[1])); in BM_Connection_Unidirectional()
111 int fds[2]; in BM_Connection_Echo() local
112 if (adb_socketpair(fds) != 0) { in BM_Connection_Echo()
116 auto client = MakeConnection<ConnectionType>(unique_fd(fds[0])); in BM_Connection_Echo()
117 auto server = MakeConnection<ConnectionType>(unique_fd(fds[1])); in BM_Connection_Echo()
Dshell_service_protocol_test.cpp43 int fds[2]; in SetUp() local
44 ASSERT_EQ(0, adb_socketpair(fds)); in SetUp()
45 read_fd_ = fds[0]; in SetUp()
46 write_fd_ = fds[1]; in SetUp()
/system/libbase/include/android-base/
Dcmsg.h55 const std::vector<int>& fds);
62 std::vector<android::base::unique_fd>* fds);
72 std::vector<int> fds; in SendFileDescriptors() local
73 Append(fds, std::forward<Args>(sent_fds)...); in SendFileDescriptors()
74 return SendFileDescriptorVector(sock, data, len, fds); in SendFileDescriptors()
83 std::vector<unique_fd*> fds; in ReceiveFileDescriptors() local
84 Append(fds, std::forward<Args>(received_fds)...); in ReceiveFileDescriptors()
87 ssize_t rc = ReceiveFileDescriptorVector(sock, data, len, fds.size(), &result); in ReceiveFileDescriptors()
88 if (rc == -1 || result.size() != fds.size()) { in ReceiveFileDescriptors()
90 for (unique_fd* fd : fds) { in ReceiveFileDescriptors()
[all …]
/system/extras/tests/pagingtest/
Dthrashing_test.c15 int fds[4] = {-1, -1, -1, -1}; in thrashing_test() local
34 filesize = num_pages * pagesize / (ARRAY_SIZE(fds) - 1); in thrashing_test()
36 for (size_t i = 0; i < ARRAY_SIZE(fds); i++) { in thrashing_test()
37 fds[i] = create_tmp_file(tmpnames[i], filesize); in thrashing_test()
38 if (fds[i] < 0) { in thrashing_test()
43 for (size_t i = 0; i < ARRAY_SIZE(fds); i++) { in thrashing_test()
44 bufs[i] = mmap(NULL, filesize, PROT_READ, MAP_PRIVATE, fds[i], 0); in thrashing_test()
52 posix_fadvise(fds[i], 0, filesize, POSIX_FADV_RANDOM); in thrashing_test()
60 for (size_t j = 0; j < ARRAY_SIZE(fds); j++) { in thrashing_test()
73 (filesize * ARRAY_SIZE(fds) * test_runs * USEC_PER_SEC) / in thrashing_test()
[all …]
/system/libbase/
Dcmsg.cpp33 const std::vector<int>& fds) { in SendFileDescriptorVector() argument
35 size_t cmsg_space = CMSG_SPACE(sizeof(int) * fds.size()); in SendFileDescriptorVector()
36 size_t cmsg_len = CMSG_LEN(sizeof(int) * fds.size()); in SendFileDescriptorVector()
61 for (size_t i = 0; i < fds.size(); ++i) { in SendFileDescriptorVector()
62 cmsg_fds[i] = fds[i]; in SendFileDescriptorVector()
75 std::vector<unique_fd>* fds) { in ReceiveFileDescriptorVector() argument
76 fds->clear(); in ReceiveFileDescriptorVector()
164 LOG(ERROR) << "received too many file descriptors, expected " << fds->size() << ", received " in ReceiveFileDescriptorVector()
170 *fds = std::move(received_fds); in ReceiveFileDescriptorVector()
Dabi_compatibility.cpp34 const std::vector<int>& fds) { in SendFileDescriptorVector() argument
35 return SendFileDescriptorVector(borrowed_fd(sockfd), data, len, fds); in SendFileDescriptorVector()
39 std::vector<unique_fd>* fds) { in ReceiveFileDescriptorVector() argument
40 return ReceiveFileDescriptorVector(borrowed_fd(sockfd), data, len, max_fds, fds); in ReceiveFileDescriptorVector()
/system/extras/tests/storage/
Dopentest.c30 int *fds; in main() local
64 fds = malloc(nfiles * sizeof(int)); in main()
65 if (fds == 0) { in main()
84 fds[i] = open(name, O_WRONLY | O_CREAT, 0666); in main()
85 if (fds[i] < 0) { in main()
/system/media/audio_utils/tests/
Dgetch.c38 fd_set fds; in kbhit() local
39 FD_ZERO(&fds); // not in original posting to stackoverflow in kbhit()
40 FD_SET(0, &fds); in kbhit()
41 return select(1, &fds, NULL, NULL, &tv); in kbhit()
/system/netd/client/
DNetdClientTest.cpp46 pollfd fds[1] = {{.fd = dnsProxyFd, .events = POLLIN}}; in serverLoop() local
49 int poll_result = TEMP_FAILURE_RETRY(poll(fds, std::size(fds), -1)); in serverLoop()
52 if (fds[SERVERFD].revents & POLLERR) return; in serverLoop()
53 if (fds[SERVERFD].revents & POLLIN) { in serverLoop()
55 TEMP_FAILURE_RETRY(read(fds[SERVERFD].fd, &buf, sizeof(buf))); in serverLoop()
57 TEMP_FAILURE_RETRY(write(fds[SERVERFD].fd, NOT_SUPPORT_MSG, sizeof(NOT_SUPPORT_MSG))); in serverLoop()
/system/core/adb/daemon/
Dframebuffer_service.cpp66 int fds[2]; in framebuffer_service() local
69 if (pipe2(fds, O_CLOEXEC) < 0) return; in framebuffer_service()
75 dup2(fds[1], STDOUT_FILENO); in framebuffer_service()
76 adb_close(fds[0]); in framebuffer_service()
77 adb_close(fds[1]); in framebuffer_service()
84 adb_close(fds[1]); in framebuffer_service()
85 fd_screencap = fds[0]; in framebuffer_service()
184 adb_close(fds[0]); in framebuffer_service()
/system/core/libsysutils/src/
DSocketListener.cpp153 std::vector<pollfd> fds; in runListener() local
156 fds.reserve(2 + mClients.size()); in runListener()
157 fds.push_back({.fd = mCtrlPipe[0], .events = POLLIN}); in runListener()
158 if (mListen) fds.push_back({.fd = mSock, .events = POLLIN}); in runListener()
163 fds.push_back({.fd = fd, .events = POLLIN}); in runListener()
168 int rc = TEMP_FAILURE_RETRY(poll(fds.data(), fds.size(), -1)); in runListener()
175 if (fds[0].revents & (POLLIN | POLLERR)) { in runListener()
183 if (mListen && (fds[1].revents & (POLLIN | POLLERR))) { in runListener()
199 const int size = fds.size(); in runListener()
201 const struct pollfd& p = fds[i]; in runListener()
/system/netd/tests/
Dnetlink_listener_test.cpp118 int fds[totalNumber]; in checkMassiveSocketDestroy() local
120 fds[i] = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); in checkMassiveSocketDestroy()
122 EXPECT_LE(0, fds[i]) << i << " of " << totalNumber; in checkMassiveSocketDestroy()
123 if (fds[i] < 0) { in checkMassiveSocketDestroy()
130 qtaguid_tagSocket(fds[i], TEST_TAG, TEST_UID); in checkMassiveSocketDestroy()
136 EXPECT_EQ(0, close(fds[i])); in checkMassiveSocketDestroy()
/system/bt/hci/src/
Dhci_layer_linux.cc152 fd_set fds; in monitor_socket() local
153 FD_ZERO(&fds); in monitor_socket()
154 FD_SET(ctrl_fd, &fds); in monitor_socket()
155 FD_SET(fd, &fds); in monitor_socket()
156 int res = select(std::max(fd, ctrl_fd) + 1, &fds, NULL, NULL, NULL); in monitor_socket()
159 if (FD_ISSET(ctrl_fd, &fds)) { in monitor_socket()
282 struct pollfd fds[1]; in wait_hcidev() local
306 fds[0].fd = fd; in wait_hcidev()
307 fds[0].events = POLLIN; in wait_hcidev()
324 OSI_NO_INTR(n = poll(fds, 1, MGMT_EV_POLL_TIMEOUT)); in wait_hcidev()
[all …]
/system/connectivity/wificond/tests/
Dshell_utils.cpp60 int fds[2]; in RunShellCommand() local
61 if (pipe2(fds, O_NONBLOCK) != 0) { in RunShellCommand()
64 unique_fd read_fd(fds[0]); in RunShellCommand()
65 unique_fd write_fd(fds[1]); in RunShellCommand()
Dlooper_backed_event_loop_unittest.cpp40 int fds[2]; in Pipe() local
41 ::pipe(fds); in Pipe()
43 receive_fd = android::base::unique_fd(fds[0]); in Pipe()
44 send_fd = android::base::unique_fd(fds[1]); in Pipe()
/system/tools/aidl/build/aidl_api/test-root-package/current/test_package/
DIBaz.aidl26 void writePFDArray(in ParcelFileDescriptor[] fds); in writePFDArray() argument
27 void readWritePFDArray(inout ParcelFileDescriptor[] fds); in readWritePFDArray() argument
/system/tools/aidl/build/test_package/
DIBaz.aidl30 void writePFDArray(in ParcelFileDescriptor[] fds); in writePFDArray() argument
31 void readWritePFDArray(inout ParcelFileDescriptor[] fds); in readWritePFDArray() argument
/system/core/libutils/include/utils/
DFlattenable.h115 inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const;
124 inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count);
137 void*& buffer, size_t& size, int*& fds, size_t& count) const { in flatten() argument
138 return static_cast<T const*>(this)->T::flatten(buffer, size, fds, count); in flatten()
142 void const*& buffer, size_t& size, int const*& fds, size_t& count) { in unflatten() argument
143 return static_cast<T*>(this)->T::unflatten(buffer, size, fds, count); in unflatten()
/system/core/libappfuse/
DFuseBuffer.cc140 base::unique_fd fds[2]; in SetupMessageSockets() local
147 fds[0].reset(raw_fds[0]); in SetupMessageSockets()
148 fds[1].reset(raw_fds[1]); in SetupMessageSockets()
152 if (setsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, &kMaxMessageSize, sizeof(int)) != 0 || in SetupMessageSockets()
153 setsockopt(fds[1], SOL_SOCKET, SO_SNDBUF, &kMaxMessageSize, sizeof(int)) != 0) { in SetupMessageSockets()
158 (*result)[0] = std::move(fds[0]); in SetupMessageSockets()
159 (*result)[1] = std::move(fds[1]); in SetupMessageSockets()
/system/core/adb/fdevent/
Dfdevent_test.cpp144 int fds[2]; in TEST_F() local
145 ASSERT_EQ(0, adb_socketpair(fds)); in TEST_F()
146 read_fds.push_back(fds[0]); in TEST_F()
147 write_fds.push_back(fds[1]); in TEST_F()
242 int fds[2]; in TEST_F() local
243 ASSERT_EQ(0, adb_socketpair(fds)); in TEST_F()
246 test.fde = fdevent_create(fds[0], [](fdevent* fde, unsigned events, void* arg) { in TEST_F()
278 ASSERT_EQ(1, adb_write(fds[1], "", 1)); in TEST_F()
288 adb_close(fds[1]); in TEST_F()
/system/tools/aidl/tests/
Daidl_test_client_file_descriptors.cpp38 int fds[2]; in DoPipe() local
39 int ret = pipe(fds); in DoPipe()
42 read_side->reset(fds[0]); in DoPipe()
43 write_side->reset(fds[1]); in DoPipe()
/system/teeui/libteeui/src/
Devdev.cpp125 std::vector<pollfd> fds(receivers_.size() + 1); in start() local
126 fds[0] = {eventFd_, POLLIN, 0}; in start()
129 fds[i] = {receiver.eventFd, receiver.eventFlags, 0}; in start()
132 auto rc = poll(fds.data(), fds.size(), runTimers()); in start()
141 if (fds[i].revents & receiver.eventFlags) { in start()
142 receiver.handleEvent(fds[i].revents); in start()
/system/core/libappfuse/tests/
DFuseBufferTest.cc196 base::unique_fd fds[2]; in TEST() local
197 SetupMessageSockets(&fds); in TEST()
199 std::thread thread([&fds] { in TEST()
202 ASSERT_TRUE(request.Read(fds[1])); in TEST()
208 ASSERT_TRUE(request.Write(fds[0])); in TEST()
/system/bt/vendor_libs/linux/interface/
Dbluetooth_hci.cc117 struct pollfd fds[1]; in waitHciDev() local
138 fds[0].fd = fd; in waitHciDev()
139 fds[0].events = POLLIN; in waitHciDev()
156 WRITE_NO_INTR(n = poll(fds, 1, -1)); in waitHciDev()
167 if (fds[0].revents & POLLIN) { in waitHciDev()

1234