/aosp12/bionic/libc/bionic/ |
H A D | dup.cpp | 35 extern "C" int __dup3(int old_fd, int new_fd, int flags); 41 int dup2(int old_fd, int new_fd) { in dup2() argument 45 if (old_fd == new_fd) { in dup2() 52 return FDTRACK_CREATE(__dup3(old_fd, new_fd, 0)); in dup2() 55 int dup3(int old_fd, int new_fd, int flags) { in dup3() argument 56 return FDTRACK_CREATE(__dup3(old_fd, new_fd, flags)); in dup3()
|
H A D | spawn.cpp | 54 int new_fd; member 64 if (fd != new_fd) { in Do() 65 if (dup2(fd, new_fd) == -1) _exit(127); in Do() 72 if (dup2(fd, new_fd) == -1) _exit(127); in Do() 295 int new_fd, in posix_spawn_add_file_action() argument 315 action->new_fd = new_fd; in posix_spawn_add_file_action() 340 int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* actions, int fd, int new_fd) { in posix_spawn_file_actions_adddup2() argument 341 if (fd < 0 || new_fd < 0) return EBADF; in posix_spawn_file_actions_adddup2() 342 return posix_spawn_add_file_action(actions, kDup2, fd, new_fd, nullptr, 0, 0); in posix_spawn_file_actions_adddup2()
|
/aosp12/frameworks/base/core/jni/ |
H A D | fd_utils.cpp | 338 if (new_fd == -1) { in ReopenOrDetach() 346 close(new_fd); in ReopenOrDetach() 348 new_fd, in ReopenOrDetach() 355 close(new_fd); in ReopenOrDetach() 357 new_fd, in ReopenOrDetach() 364 close(new_fd); in ReopenOrDetach() 366 new_fd, in ReopenOrDetach() 372 if (TEMP_FAILURE_RETRY(dup3(new_fd, fd, dup_flags)) == -1) { in ReopenOrDetach() 373 close(new_fd); in ReopenOrDetach() 376 new_fd, in ReopenOrDetach() [all …]
|
H A D | com_android_internal_os_ZygoteCommandBuffer.cpp | 229 void setFd(int new_fd) { in setFd() argument 230 mFd = new_fd; in setFd() 454 int new_fd = TEMP_FAILURE_RETRY(accept(zygote_socket_fd, nullptr, nullptr)); in com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly() local 455 if (new_fd == -1) { in com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly() 458 if (new_fd != session_socket) { in com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly() 461 if (TEMP_FAILURE_RETRY(dup2(new_fd, session_socket)) != session_socket) { in com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly() 463 new_fd, session_socket, strerror(errno))); in com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly() 465 close(new_fd); // On Linux, fd is closed even if EINTR is returned. in com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly()
|
/aosp12/packages/modules/adb/daemon/ |
H A D | adb_wifi.cpp | 140 unique_fd new_fd(adb_socket_accept(fd, nullptr, nullptr)); in OnFdEvent() local 141 if (new_fd >= 0) { in OnFdEvent() 142 LOG(INFO) << "New TLS connection [fd=" << new_fd.get() << "]"; in OnFdEvent() 143 close_on_exec(new_fd.get()); in OnFdEvent() 144 disable_tcp_nagle(new_fd.get()); in OnFdEvent() 145 std::string serial = android::base::StringPrintf("host-%d", new_fd.get()); in OnFdEvent() 147 std::move(new_fd), std::move(serial), port_, 1, in OnFdEvent()
|
/aosp12/system/logging/liblog/ |
H A D | pmsg_writer.cpp | 41 int new_fd = TEMP_FAILURE_RETRY(open("/dev/pmsg0", O_WRONLY | O_CLOEXEC)); in GetPmsgFd() local 45 if (new_fd == 0) { in GetPmsgFd() 46 new_fd = TEMP_FAILURE_RETRY(open("/dev/pmsg0", O_WRONLY | O_CLOEXEC)); in GetPmsgFd() 56 if (!pmsg_fd.compare_exchange_strong(uninitialized_value, new_fd)) { in GetPmsgFd() 57 if (new_fd != -1) { in GetPmsgFd() 58 close(new_fd); in GetPmsgFd()
|
/aosp12/system/update_engine/payload_generator/ |
H A D | block_mapping.cc | 151 int new_fd = HANDLE_EINTR(open(new_part.c_str(), O_RDONLY)); in MapPartitionBlocks() local 153 ScopedFdCloser new_fd_closer(&new_fd); in MapPartitionBlocks() 158 new_fd, 0, new_size / block_size, new_block_ids)); in MapPartitionBlocks()
|
/aosp12/art/adbconnection/ |
H A D | adbconnection.cc | 610 android::base::unique_fd new_fd(adbconnection_client_receive_jdwp_fd(control_ctx_.get())); in RunPollLoop() local 611 if (new_fd == -1) { in RunPollLoop() 618 if (new_fd >= 0) { in RunPollLoop() 619 new_fd.reset(); in RunPollLoop() 622 VLOG(jdwp) << "Adb connection established with fd " << new_fd; in RunPollLoop() 623 adb_connection_socket_ = std::move(new_fd); in RunPollLoop()
|
/aosp12/frameworks/native/libs/adbd_auth/ |
H A D | adbd_auth.cpp | 157 void ReplaceFrameworkFd(unique_fd new_fd) REQUIRES(mutex_) { in ReplaceFrameworkFd() 158 LOG(INFO) << "adbd_auth: received new framework fd " << new_fd.get() in ReplaceFrameworkFd() 169 if (new_fd != -1) { in ReplaceFrameworkFd() 177 CHECK_EQ(0, epoll_ctl(epoll_fd_.get(), EPOLL_CTL_ADD, new_fd.get(), &event)); in ReplaceFrameworkFd() 178 framework_fd_ = std::move(new_fd); in ReplaceFrameworkFd()
|
/aosp12/packages/modules/adb/ |
H A D | socket_spec.cpp | 450 int new_fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); 451 if (new_fd < 0) { 456 return new_fd;
|
/aosp12/bionic/docs/ |
H A D | fdsan.md | 321 void reset(int new_fd = -1) { 327 if (new_fd != -1) { 328 fd_ = new_fd;
|
/aosp12/bionic/libc/stdio/ |
H A D | stdio.cpp | 1207 int new_fd = fcntl(fds[child], F_DUPFD_CLOEXEC, 0); in popen() local 1208 if (new_fd == -1) return __popen_fail(fds); in popen() 1210 fds[child] = new_fd; in popen()
|
/aosp12/packages/modules/DnsResolver/tests/ |
H A D | resolv_integration_test.cpp | 1850 int new_fd = accept4(s, reinterpret_cast<struct sockaddr*>(&cliaddr), &sin_size, SOCK_CLOEXEC); in TEST_F() local 1851 ASSERT_TRUE(new_fd > 0); in TEST_F() 1863 write(new_fd, garbage.data(), garbage.size()); in TEST_F() 1864 close(new_fd); in TEST_F()
|