/art/libartbase/base/ |
D | file_magic.cc | 34 File fd(filename, O_RDONLY, /* check_usage= */ false); in OpenAndReadMagic() local 35 if (fd.Fd() == -1) { in OpenAndReadMagic() 39 if (!ReadMagicAndReset(fd.Fd(), magic, error_msg)) { in OpenAndReadMagic() 43 return fd; in OpenAndReadMagic() 46 bool ReadMagicAndReset(int fd, uint32_t* magic, std::string* error_msg) { in ReadMagicAndReset() argument 47 int n = TEMP_FAILURE_RETRY(read(fd, magic, sizeof(*magic))); in ReadMagicAndReset() 52 if (lseek(fd, 0, SEEK_SET) != 0) { in ReadMagicAndReset()
|
D | memfd_test.cc | 23 int fd = art::memfd_create("memfd_create_test", 0); in TEST() local 24 if (fd < 0) { in TEST() 29 ASSERT_TRUE(close(fd) == 0 || errno != EBADF); in TEST()
|
D | zip_archive.cc | 205 static void SetCloseOnExec(int fd) { in SetCloseOnExec() argument 208 UNUSED(fd); in SetCloseOnExec() 212 int flags = fcntl(fd, F_GETFD); in SetCloseOnExec() 214 PLOG(WARNING) << "fcntl(" << fd << ", F_GETFD) failed"; in SetCloseOnExec() 217 int rc = fcntl(fd, F_SETFD, flags | FD_CLOEXEC); in SetCloseOnExec() 219 PLOG(WARNING) << "fcntl(" << fd << ", F_SETFD, " << flags << ") failed"; in SetCloseOnExec() 240 ZipArchive* ZipArchive::OpenFromFd(int fd, const char* filename, std::string* error_msg) { in OpenFromFd() argument 242 DCHECK_GT(fd, 0); in OpenFromFd() 245 const int32_t error = OpenArchiveFd(fd, filename, &handle); in OpenFromFd()
|
D | scoped_flock.h | 57 static ScopedFlock DupOf(const int fd, const std::string& path, 71 LockedFile(int fd, const std::string& path, bool check_usage, bool read_only_mode) in LockedFile() argument 72 : FdFile(fd, path, check_usage, read_only_mode) { in LockedFile()
|
D | mem_map_unix.cc | 27 void* MemMap::TargetMMap(void* start, size_t len, int prot, int flags, int fd, off_t fd_off) { in TargetMMap() argument 28 return mmap(start, len, prot, flags, fd, fd_off); in TargetMMap()
|
D | socket_peer_is_trusted.cc | 30 bool SocketPeerIsTrusted(int fd) { in SocketPeerIsTrusted() argument 33 if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_length) != 0) { in SocketPeerIsTrusted()
|
D | zip_archive_test.cc | 53 int fd = open(tmp.GetFilename().c_str(), O_RDONLY | O_CLOEXEC); in TEST_F() local 54 ASSERT_NE(-1, fd); in TEST_F() 58 ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fd, buf, kBufSize)); in TEST_F()
|
D | memfd.cc | 104 android::base::unique_fd fd(art::memfd_create("test_android_memfd", MFD_ALLOW_SEALING)); in IsSealFutureWriteSupportedInternal() local 105 if (fd == -1) { in IsSealFutureWriteSupportedInternal() 110 if (fcntl(fd, F_ADD_SEALS, F_SEAL_FUTURE_WRITE) == -1) { in IsSealFutureWriteSupportedInternal()
|
D | mem_map.h | 183 int fd, in MapFile() argument 192 fd, in MapFile() 217 int fd, 283 int fd, 352 int fd, 359 int fd, 403 int fd, 408 static void* TargetMMap(void* start, size_t len, int prot, int flags, int fd, off_t fd_off);
|
/art/openjdkjvm/ |
D | OpenjdkJvm.cc | 81 int fd = TEMP_FAILURE_RETRY(open(fname, flags & ~JVM_O_DELETE, mode)); in JVM_Open() local 82 if (fd < 0) { in JVM_Open() 91 return fd; in JVM_Open() 95 JNIEXPORT jint JVM_Close(jint fd) { in JVM_Close() argument 97 return close(fd); in JVM_Close() 101 JNIEXPORT jint JVM_Read(jint fd, char* buf, jint nbytes) { in JVM_Read() argument 102 return TEMP_FAILURE_RETRY(read(fd, buf, nbytes)); in JVM_Read() 106 JNIEXPORT jint JVM_Write(jint fd, char* buf, jint nbytes) { in JVM_Write() argument 107 return TEMP_FAILURE_RETRY(write(fd, buf, nbytes)); in JVM_Write() 111 JNIEXPORT jlong JVM_Lseek(jint fd, jlong offset, jint whence) { in JVM_Lseek() argument [all …]
|
/art/runtime/jit/ |
D | jit_memory_region_test.cc | 62 android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg)); in BasicTest() local 63 CHECK_NE(fd.get(), -1); in BasicTest() 67 mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); in BasicTest() 76 bool res = JitMemoryRegion::ProtectZygoteMemory(fd.get(), &error_msg); in BasicTest() 85 mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); in BasicTest() 118 android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg)); in TestUnmapWritableAfterFork() local 119 CHECK_NE(fd.get(), -1); in TestUnmapWritableAfterFork() 123 mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); in TestUnmapWritableAfterFork() 133 mmap(nullptr, kPageSize, PROT_READ, MAP_SHARED, fd.get(), 0)); in TestUnmapWritableAfterFork() 137 bool res = JitMemoryRegion::ProtectZygoteMemory(fd.get(), &error_msg); in TestUnmapWritableAfterFork() [all …]
|
D | jit_memory_region.cc | 516 int fd = art::memfd_create(kRegionName, MFD_ALLOW_SEALING); in CreateZygoteMemory() local 517 if (fd == -1) { in CreateZygoteMemory() 524 if (ftruncate(fd, capacity) != 0) { in CreateZygoteMemory() 531 return fd; in CreateZygoteMemory() 536 int fd; in CreateZygoteMemory() local 537 PaletteStatus status = PaletteAshmemCreateRegion(kRegionName, capacity, &fd); in CreateZygoteMemory() 545 return fd; in CreateZygoteMemory() 548 bool JitMemoryRegion::ProtectZygoteMemory(int fd, std::string* error_msg) { in ProtectZygoteMemory() argument 550 if (fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL | F_SEAL_FUTURE_WRITE) in ProtectZygoteMemory() 558 PaletteStatus status = PaletteAshmemSetProtRegion(fd, PROT_READ); in ProtectZygoteMemory() [all …]
|
/art/libprofile/profile/ |
D | profile_boot_info.cc | 41 bool ProfileBootInfo::Save(int fd) const { in Save() 56 if (!WriteBuffer(fd, buffer.data(), buffer.size())) { in Save() 62 bool ProfileBootInfo::Load(int fd, const std::vector<const DexFile*>& dex_files) { in Load() argument 66 int bytes_read = TEMP_FAILURE_RETRY(read(fd, &string_length, sizeof(uint8_t))); in Load() 83 bytes_read = TEMP_FAILURE_RETRY(read(fd, data.get(), string_length)); in Load() 111 int bytes_read = TEMP_FAILURE_RETRY(read(fd, &dex_file_index, sizeof(dex_file_index))); in Load() 115 bytes_read = TEMP_FAILURE_RETRY(read(fd, &method_id, sizeof(method_id))); in Load()
|
D | profile_boot_info.h | 44 bool Save(int fd) const; 48 bool Load(int fd, const std::vector<const DexFile*>& dex_files);
|
D | profile_helpers.h | 29 inline bool WriteBuffer(int fd, const uint8_t* buffer, size_t byte_count) { in WriteBuffer() argument 31 int bytes_written = TEMP_FAILURE_RETRY(write(fd, buffer, byte_count)); in WriteBuffer()
|
/art/libnativebridge/tests/ |
D | CodeCacheStatFail_test.cpp | 29 int fd = creat(kCodeCache, O_RDWR); in TEST_F() local 30 ASSERT_NE(-1, fd); in TEST_F() 31 close(fd); in TEST_F()
|
/art/libdexfile/dex/ |
D | art_dex_file_loader.cc | 95 File fd; in GetMultiDexChecksums() local 98 fd = File(DupCloexec(zip_fd), /* check_usage= */ false); in GetMultiDexChecksums() 101 fd = OpenAndReadMagic(filename, &magic, error_msg); in GetMultiDexChecksums() 103 if (fd.Fd() == -1) { in GetMultiDexChecksums() 109 ZipArchive::OpenFromFd(fd.Release(), filename, error_msg)); in GetMultiDexChecksums() 143 std::unique_ptr<const DexFile> dex_file(OpenFile(fd.Release(), in GetMultiDexChecksums() 230 File fd = OpenAndReadMagic(filename, &magic, error_msg); in Open() local 231 if (fd.Fd() == -1) { in Open() 236 magic, fd.Release(), location, verify, verify_checksum, error_msg, dex_files); in Open() 239 bool ArtDexFileLoader::Open(int fd, in Open() argument [all …]
|
D | art_dex_file_loader.h | 83 bool Open(int fd, 91 std::unique_ptr<const DexFile> OpenDex(int fd, 99 bool OpenZip(int fd, 108 int fd, 115 std::unique_ptr<const DexFile> OpenFile(int fd,
|
/art/libartbase/base/unix_file/ |
D | fd_file.cc | 70 static ssize_t pread(int fd, void* data, size_t byte_count, off64_t offset) { in pread() argument 78 auto handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd)); in pread() 99 static ssize_t pwrite(int fd, const void* buf, size_t count, off64_t offset) { in pwrite() argument 107 auto handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd)); in pwrite() 128 static int fsync(int fd) { in fsync() argument 129 auto handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd)); in fsync() 145 FdFile::FdFile(int fd, bool check_usage) in FdFile() argument 146 : FdFile(fd, std::string(), check_usage) {} in FdFile() 148 FdFile::FdFile(int fd, const std::string& path, bool check_usage) in FdFile() argument 149 : FdFile(fd, path, check_usage, false) {} in FdFile() [all …]
|
D | fd_file.h | 40 FdFile(int fd, bool check_usage); 41 FdFile(int fd, const std::string& path, bool check_usage); 42 FdFile(int fd, const std::string& path, bool check_usage, bool read_only_mode); 58 void Reset(int fd, bool check_usage);
|
/art/libdexfile/external/ |
D | dex_file_supp_test.cc | 139 ASSERT_NE(tf.fd, -1); in TEST() 142 TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(art::DexFile::Header) - 1)))); in TEST() 145 EXPECT_EQ(DexFile::OpenFromFd(tf.fd, 0, tf.path, &error_msg), nullptr); in TEST() 151 ASSERT_NE(tf.fd, -1); in TEST() 154 TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(art::DexFile::Header))))); in TEST() 157 EXPECT_EQ(DexFile::OpenFromFd(tf.fd, 0, tf.path, &error_msg), nullptr); in TEST() 163 ASSERT_NE(tf.fd, -1); in TEST() 165 static_cast<size_t>(TEMP_FAILURE_RETRY(write(tf.fd, kDexData, sizeof(kDexData))))); in TEST() 168 EXPECT_NE(DexFile::OpenFromFd(tf.fd, 0, tf.path, &error_msg), nullptr); in TEST() 174 ASSERT_NE(tf.fd, -1); in TEST() [all …]
|
/art/runtime/ |
D | monitor_android.cc | 46 int fd = open("/proc/self/cmdline", O_RDONLY | O_CLOEXEC); in LogContentionEvent() local 49 read(fd, procName, sizeof(procName) - 1); in LogContentionEvent() 50 close(fd); in LogContentionEvent()
|
/art/libartpalette/system/ |
D | palette_fake.cc | 81 int* fd) { in PaletteAshmemCreateRegion() argument 82 *fd = -1; in PaletteAshmemCreateRegion() 86 enum PaletteStatus PaletteAshmemSetProtRegion(int fd ATTRIBUTE_UNUSED, in PaletteAshmemSetProtRegion()
|
/art/libartpalette/apex/ |
D | palette.cc | 154 enum PaletteStatus PaletteAshmemCreateRegion(const char* name, size_t size, int* fd) { in PaletteAshmemCreateRegion() argument 157 return m(name, size, fd); in PaletteAshmemCreateRegion() 160 enum PaletteStatus PaletteAshmemSetProtRegion(int fd, int prot) { in PaletteAshmemSetProtRegion() argument 163 return m(fd, prot); in PaletteAshmemSetProtRegion()
|
/art/profman/ |
D | profman.cc | 77 static bool FdIsValid(int fd) { in FdIsValid() argument 78 return fd != kInvalidFd; in FdIsValid() 612 std::unique_ptr<const ProfileCompilationInfo> LoadProfile(const std::string& filename, int fd) { in LoadProfile() argument 619 fd = open(filename.c_str(), flags); in LoadProfile() 620 if (fd < 0) { in LoadProfile() 626 if (!info->Load(fd)) { in LoadProfile() 627 LOG(ERROR) << "Cannot load profile info from fd=" << fd << "\n"; in LoadProfile() 635 int fd, in DumpOneProfile() argument 638 std::unique_ptr<const ProfileCompilationInfo> info(LoadProfile(filename, fd)); in DumpOneProfile() 640 LOG(ERROR) << "Cannot load profile info from filename=" << filename << " fd=" << fd; in DumpOneProfile() [all …]
|