/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* _Nullable 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() 58 int ppoll(struct pollfd* _Nullable const fds __pass_object_size, nfds_t fd_count, const struct 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 | spawn_test.cpp | 236 int fds[2]; in TEST() local 237 ASSERT_NE(-1, pipe(fds)); in TEST() 243 ASSERT_EQ(0, posix_spawn_file_actions_addclose(&fa, fds[0])); in TEST() 244 ASSERT_EQ(0, posix_spawn_file_actions_adddup2(&fa, fds[1], 1)); in TEST() 245 ASSERT_EQ(0, posix_spawn_file_actions_addclose(&fa, fds[1])); in TEST() 247 ASSERT_EQ(0, posix_spawn_file_actions_addclose(&fa, fds[1])); in TEST() 264 ASSERT_EQ(0, close(fds[1])); in TEST() 266 ASSERT_TRUE(android::base::ReadFdToString(fds[0], &content)); in TEST() 267 ASSERT_EQ(0, close(fds[0])); in TEST() 290 int fds[2]; in CatFileToString() local [all …]
|
D | utils.h | 227 int fds[2]; in Run() local 228 ASSERT_NE(pipe(fds), -1); in Run() 235 close(fds[0]); in Run() 236 dup2(fds[1], STDOUT_FILENO); in Run() 237 dup2(fds[1], STDERR_FILENO); in Run() 238 if (fds[1] != STDOUT_FILENO && fds[1] != STDERR_FILENO) close(fds[1]); in Run() 244 close(fds[1]); in Run() 248 while ((bytes_read = TEMP_FAILURE_RETRY(read(fds[0], buf, sizeof(buf)))) > 0) { in Run() 251 close(fds[0]); in Run()
|
D | fdtrack_test.cpp | 194 void SetFdResult(std::vector<int>* output, std::vector<int> fds) { in SetFdResult() argument 195 *output = fds; in SetFdResult() 269 std::vector<int> fds = { -1, -1}; 270 if (pipe(fds.data()) != 0) { 273 fds; 277 std::vector<int> fds = { -1, -1}; 278 if (pipe2(fds.data(), O_CLOEXEC) != 0) { 281 fds; 285 std::vector<int> fds = { -1, -1}; 286 if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds.data()) != 0) { [all …]
|
D | sys_epoll_test.cpp | 132 int fds[2]; in TEST() local 133 ASSERT_NE(-1, pipe(fds)); in TEST() 141 ASSERT_NE(-1, epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fds[0], &ev)); in TEST() 144 ASSERT_EQ(1, write(fds[1], "\n", 1)); in TEST() 151 close(fds[0]); in TEST() 152 close(fds[1]); in TEST()
|
D | fdsan_test.cpp | 140 std::unordered_map<int, uint64_t> fds; in TEST_F() local 145 fds[fd] = tag; in TEST_F() 148 for (auto [fd, tag] : fds) { in TEST_F()
|
D | clang_fortify_tests.cpp | 429 } fds = { { poll_fd, poll_fd }, { poll_fd } }; in FORTIFY_TEST() local 430 static_assert(sizeof(fds) >= sizeof(struct pollfd) * 3, ""); in FORTIFY_TEST() 435 EXPECT_FORTIFY_DEATH_STRUCT(poll(fds.few, 3, 0)); in FORTIFY_TEST() 441 EXPECT_FORTIFY_DEATH_STRUCT(ppoll(fds.few, 3, &timeout, 0)); in FORTIFY_TEST() 446 EXPECT_FORTIFY_DEATH_STRUCT(ppoll64(fds.few, 3, 0, nullptr)); in FORTIFY_TEST()
|
D | ifaddrs_test.cpp | 292 std::vector<int> fds; in TEST() local 299 fds.push_back(fd); in TEST() 306 for (int fd : fds) close(fd); in TEST()
|
/bionic/benchmarks/tests/ |
D | interface_test.cpp | 75 int fds[2]; in Exec() local 76 ASSERT_NE(-1, pipe(fds)); in Exec() 77 ASSERT_NE(-1, fcntl(fds[0], F_SETFL, O_NONBLOCK)); in Exec() 81 close(fds[0]); in Exec() 85 ASSERT_NE(0, dup2(fds[1], STDOUT_FILENO)); in Exec() 86 ASSERT_NE(0, dup2(fds[1], STDERR_FILENO)); in Exec() 87 close(fds[1]); in Exec() 97 close(fds[1]); in Exec() 98 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 54 return ppoll64(fds, fd_count, ts, set.ptr); in ppoll() 57 int ppoll64(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset64_t* ss) { in ppoll64() argument 73 return __ppoll(fds, fd_count, mutable_ts_ptr, mutable_ss_ptr, sizeof(*mutable_ss_ptr)); in ppoll64()
|
D | fortify.cpp | 158 int __poll_chk(pollfd* fds, nfds_t fd_count, int timeout, size_t fds_size) { in __poll_chk() argument 160 return poll(fds, fd_count, timeout); in __poll_chk() 163 int __ppoll_chk(pollfd* fds, nfds_t fd_count, const timespec* timeout, in __ppoll_chk() argument 166 return ppoll(fds, fd_count, timeout, mask); in __ppoll_chk() 169 int __ppoll64_chk(pollfd* fds, nfds_t fd_count, const timespec* timeout, in __ppoll64_chk() argument 172 return ppoll64(fds, fd_count, timeout, mask); in __ppoll64_chk()
|
/bionic/libc/stdio/ |
D | stdio.cpp | 1175 static FILE* __popen_fail(int fds[2]) { in __popen_fail() 1177 close(fds[0]); in __popen_fail() 1178 close(fds[1]); in __popen_fail() 1184 int fds[2]; in popen() local 1187 if (socketpair(AF_LOCAL, SOCK_CLOEXEC | SOCK_STREAM, 0, fds) == -1) return nullptr; in popen() 1191 if (pipe2(fds, O_CLOEXEC) == -1) return nullptr; in popen() 1208 if (fds[child] == desired_child_fd) { in popen() 1209 int new_fd = fcntl(fds[child], F_DUPFD_CLOEXEC, 0); in popen() 1210 if (new_fd == -1) return __popen_fail(fds); in popen() 1211 close(fds[child]); in popen() [all …]
|
/bionic/libc/malloc_debug/tests/ |
D | malloc_debug_system_tests.cpp | 252 int fds[2]; in InternalExec() local 253 ASSERT_NE(-1, pipe(fds)); in InternalExec() 254 ASSERT_NE(-1, fcntl(fds[0], F_SETFL, O_NONBLOCK)); in InternalExec() 257 close(fds[0]); in InternalExec() 261 ASSERT_NE(0, dup2(fds[1], STDOUT_FILENO)); in InternalExec() 262 ASSERT_NE(0, dup2(fds[1], STDERR_FILENO)); in InternalExec() 279 close(fds[1]); in InternalExec() 291 struct pollfd read_fd = {.fd = fds[0], .events = POLLIN}; in InternalExec() 293 ssize_t bytes = TEMP_FAILURE_RETRY(read(fds[0], buffer.data(), sizeof(buffer) - 1)); in InternalExec()
|
/bionic/docs/ |
D | clang_fortify_anatomy.md | 570 #define __bos_fd_count_trivially_safe(bos_val, fds, fd_count) \ 573 (bos_val) >= sizeof(*fds) * (fd_count))) 579 int poll(struct pollfd* const fds __attribute__((pass_object_size(1))), nfds_t fd_count, int timeou… 582 … __builtin_object_size(fds, 1) != -1 && __builtin_object_size(fds, 1) < sizeof(*fds) * fd_count, 585 size_t bos_fds = __builtin_object_size(fds, 1); 586 if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) { 587 return __poll_chk(fds, fd_count, timeout, bos_fds); 589 return (&poll)(fds, fd_count, timeout); 599 - When `fds` is too small to hold `fd_count` `pollfd`s, Clang will emit a 602 - When `fds` is a constant according to `__builtin_constant_p`, this always [all …]
|
D | fdtrack.md | 39 spawning a thread that regularly checks the count of fds in the process, turns
|
/bionic/libc/ |
D | SECCOMP_ALLOWLIST_APP.TXT | 36 int poll:poll(struct pollfd *fds, nfds_t nfds, int timeout) lp32
|
/bionic/libc/kernel/uapi/linux/ |
D | io_uring.h | 332 __aligned_u64 fds; member
|
/bionic/libc/dns/resolv/ |
D | res_send.c | 1028 struct pollfd fds = { .fd = sock, .events = events }; in retrying_poll() local 1029 int n = ppoll(&fds, 1, &timeout, /*sigmask=*/NULL); in retrying_poll() 1047 if (fds.revents & (POLLIN | POLLOUT | POLLERR)) { in retrying_poll()
|