/bionic/libc/include/bits/fortify/ |
D | poll.h | 38 #define __bos_fd_count_trivially_safe(bos_val, fds, fd_count) \ argument 39 __bos_dynamic_check_impl_and((bos_val), >=, (sizeof(*fds) * (fd_count)), \ 40 (fd_count) <= __BIONIC_CAST(static_cast, nfds_t, -1) / sizeof(*fds)) 43 int poll(struct pollfd* const fds __pass_object_size, nfds_t fd_count, int timeout) in poll() 45 __clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count), in poll() 48 size_t bos_fds = __bos(fds); in poll() 50 if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) { in poll() 51 return __poll_chk(fds, fd_count, timeout, bos_fds); in poll() 54 return __call_bypassing_fortify(poll)(fds, fd_count, timeout); in poll() 59 int ppoll(struct pollfd* const fds __pass_object_size, nfds_t fd_count, const struct timespec* time… in ppoll() [all …]
|
/bionic/tests/ |
D | sys_select_test.cpp | 29 fd_set fds; in TEST() local 30 FD_ZERO(&fds); in TEST() 33 EXPECT_FALSE(FD_ISSET(i, &fds)); in TEST() 36 FD_SET(0, &fds); in TEST() 37 EXPECT_TRUE(FD_ISSET(0, &fds)); in TEST() 38 EXPECT_FALSE(FD_ISSET(1, &fds)); in TEST() 39 FD_SET(1, &fds); in TEST() 40 EXPECT_TRUE(FD_ISSET(0, &fds)); in TEST() 41 EXPECT_TRUE(FD_ISSET(1, &fds)); in TEST() 42 FD_CLR(0, &fds); in TEST() [all …]
|
D | sys_epoll_test.cpp | 60 int fds[2]; in TEST() local 61 ASSERT_NE(-1, pipe(fds)); in TEST() 69 ASSERT_NE(-1, epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fds[0], &ev)); in TEST() 72 ASSERT_EQ(1, write(fds[1], "\n", 1)); in TEST() 79 close(fds[0]); in TEST() 80 close(fds[1]); in TEST()
|
D | utils.h | 216 int fds[2]; in Run() local 217 ASSERT_NE(pipe(fds), -1); in Run() 224 close(fds[0]); in Run() 225 dup2(fds[1], STDOUT_FILENO); in Run() 226 dup2(fds[1], STDERR_FILENO); in Run() 227 if (fds[1] != STDOUT_FILENO && fds[1] != STDERR_FILENO) close(fds[1]); in Run() 233 close(fds[1]); in Run() 237 while ((bytes_read = TEMP_FAILURE_RETRY(read(fds[0], buf, sizeof(buf)))) > 0) { in Run() 240 close(fds[0]); in Run()
|
D | fdtrack_test.cpp | 134 void SetFdResult(std::vector<int>* output, std::vector<int> fds) { in SetFdResult() argument 135 *output = fds; in SetFdResult() 191 std::vector<int> fds = { -1, -1}; 192 if (pipe(fds.data()) != 0) { 195 fds; 199 std::vector<int> fds = { -1, -1}; 200 if (pipe2(fds.data(), O_CLOEXEC) != 0) { 203 fds; 207 std::vector<int> fds = { -1, -1}; 208 if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds.data()) != 0) { [all …]
|
D | spawn_test.cpp | 233 int fds[2]; in TEST() local 234 ASSERT_NE(-1, pipe(fds)); in TEST() 239 ASSERT_EQ(0, posix_spawn_file_actions_addclose(&fa, fds[0])); in TEST() 240 ASSERT_EQ(0, posix_spawn_file_actions_adddup2(&fa, fds[1], 1)); in TEST() 241 ASSERT_EQ(0, posix_spawn_file_actions_addclose(&fa, fds[1])); in TEST() 243 ASSERT_EQ(0, posix_spawn_file_actions_addclose(&fa, fds[1])); in TEST() 252 ASSERT_EQ(0, close(fds[1])); in TEST() 254 ASSERT_TRUE(android::base::ReadFdToString(fds[0], &content)); in TEST() 255 ASSERT_EQ(0, close(fds[0])); in TEST() 269 int fds[2]; in CatFileToString() local [all …]
|
D | fdsan_test.cpp | 131 std::unordered_map<int, uint64_t> fds; in TEST_F() local 136 fds[fd] = tag; in TEST_F() 139 for (auto [fd, tag] : fds) { in TEST_F()
|
D | clang_fortify_tests.cpp | 445 } fds = { { poll_fd, poll_fd }, { poll_fd } }; in FORTIFY_TEST() local 446 static_assert(sizeof(fds) >= sizeof(struct pollfd) * 3, ""); in FORTIFY_TEST() 451 EXPECT_FORTIFY_DEATH_STRUCT(poll(fds.few, 3, 0)); in FORTIFY_TEST() 457 EXPECT_FORTIFY_DEATH_STRUCT(ppoll(fds.few, 3, &timeout, 0)); in FORTIFY_TEST() 462 EXPECT_FORTIFY_DEATH_STRUCT(ppoll64(fds.few, 3, 0, nullptr)); in FORTIFY_TEST()
|
D | ifaddrs_test.cpp | 293 std::vector<int> fds; in TEST() local 300 fds.push_back(fd); in TEST() 307 for (int fd : fds) close(fd); in TEST()
|
/bionic/benchmarks/tests/ |
D | interface_test.cpp | 79 int fds[2]; in Exec() local 80 ASSERT_NE(-1, pipe(fds)); in Exec() 81 ASSERT_NE(-1, fcntl(fds[0], F_SETFL, O_NONBLOCK)); in Exec() 85 close(fds[0]); in Exec() 89 ASSERT_NE(0, dup2(fds[1], STDOUT_FILENO)); in Exec() 90 ASSERT_NE(0, dup2(fds[1], STDERR_FILENO)); in Exec() 91 close(fds[1]); in Exec() 100 close(fds[1]); in Exec() 101 fd_ = fds[0]; in Exec()
|
/bionic/libc/bionic/ |
D | poll.cpp | 41 int poll(pollfd* fds, nfds_t fd_count, int ms) { in poll() argument 48 return __ppoll(fds, fd_count, ts_ptr, nullptr, 0); in poll() 51 int ppoll(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset_t* ss) { in ppoll() argument 60 return ppoll64(fds, fd_count, ts, ss_ptr); in ppoll() 63 int ppoll64(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset64_t* ss) { in ppoll64() argument 79 return __ppoll(fds, fd_count, mutable_ts_ptr, mutable_ss_ptr, sizeof(*mutable_ss_ptr)); in ppoll64()
|
D | fortify.cpp | 161 int __poll_chk(pollfd* fds, nfds_t fd_count, int timeout, size_t fds_size) { in __poll_chk() argument 163 return poll(fds, fd_count, timeout); in __poll_chk() 166 int __ppoll_chk(pollfd* fds, nfds_t fd_count, const timespec* timeout, in __ppoll_chk() argument 169 return ppoll(fds, fd_count, timeout, mask); in __ppoll_chk() 172 int __ppoll64_chk(pollfd* fds, nfds_t fd_count, const timespec* timeout, in __ppoll64_chk() argument 175 return ppoll64(fds, fd_count, timeout, mask); in __ppoll64_chk()
|
/bionic/libc/malloc_debug/tests/ |
D | malloc_debug_system_tests.cpp | 71 int fds[2]; in Exec() local 72 ASSERT_NE(-1, pipe(fds)); in Exec() 73 ASSERT_NE(-1, fcntl(fds[0], F_SETFL, O_NONBLOCK)); in Exec() 76 close(fds[0]); in Exec() 80 ASSERT_NE(0, dup2(fds[1], STDOUT_FILENO)); in Exec() 81 ASSERT_NE(0, dup2(fds[1], STDERR_FILENO)); in Exec() 98 close(fds[1]); in Exec() 105 struct pollfd read_fd = {.fd = fds[0], .events = POLLIN}; in Exec() 107 ssize_t bytes = TEMP_FAILURE_RETRY(read(fds[0], buffer.data(), sizeof(buffer) - 1)); in Exec()
|
/bionic/libc/stdio/ |
D | stdio.cpp | 1178 static FILE* __popen_fail(int fds[2]) { in __popen_fail() 1180 close(fds[0]); in __popen_fail() 1181 close(fds[1]); in __popen_fail() 1187 int fds[2]; in popen() local 1190 if (socketpair(AF_LOCAL, SOCK_CLOEXEC | SOCK_STREAM, 0, fds) == -1) return nullptr; in popen() 1194 if (pipe2(fds, O_CLOEXEC) == -1) return nullptr; in popen() 1211 if (fds[child] == desired_child_fd) { in popen() 1212 int new_fd = fcntl(fds[child], F_DUPFD_CLOEXEC, 0); in popen() 1213 if (new_fd == -1) return __popen_fail(fds); in popen() 1214 close(fds[child]); in popen() [all …]
|
/bionic/libc/kernel/uapi/linux/ |
D | io_uring.h | 135 __aligned_u64 fds; member
|
/bionic/libc/ |
D | SECCOMP_WHITELIST_APP.TXT | 36 int poll:poll(struct pollfd *fds, nfds_t nfds, int timeout) lp32
|
/bionic/libc/dns/resolv/ |
D | res_send.c | 1031 struct pollfd fds = { .fd = sock, .events = events }; in retrying_poll() local 1032 int n = ppoll(&fds, 1, &timeout, /*sigmask=*/NULL); in retrying_poll() 1050 if (fds.revents & (POLLIN | POLLOUT | POLLERR)) { in retrying_poll()
|