Lines Matching refs:fd
61 ScopedFd fd(open(filename, O_RDONLY, 0)); in OpenAndReadMagic() local
62 if (fd.get() == -1) { in OpenAndReadMagic()
66 int n = TEMP_FAILURE_RETRY(read(fd.get(), magic, sizeof(*magic))); in OpenAndReadMagic()
71 if (lseek(fd.get(), 0, SEEK_SET) != 0) { in OpenAndReadMagic()
76 return fd.release(); in OpenAndReadMagic()
95 ScopedFd fd(OpenAndReadMagic(file_part, &magic, error_msg)); in GetChecksum() local
96 if (fd.get() == -1) { in GetChecksum()
102 ZipArchive::OpenFromFd(fd.release(), filename, error_msg)); in GetChecksum()
119 DexFile::OpenFile(fd.release(), filename, false, error_msg)); in GetChecksum()
134 ScopedFd fd(OpenAndReadMagic(filename, &magic, error_msg)); in Open() local
135 if (fd.get() == -1) { in Open()
140 return DexFile::OpenZip(fd.release(), location, error_msg, dex_files); in Open()
143 std::unique_ptr<const DexFile> dex_file(DexFile::OpenFile(fd.release(), location, true, in Open()
156 static bool ContainsClassesDex(int fd, const char* filename) { in ContainsClassesDex() argument
158 std::unique_ptr<ZipArchive> zip_archive(ZipArchive::OpenFromFd(fd, filename, &error_msg)); in ContainsClassesDex()
169 ScopedFd fd(OpenAndReadMagic(filename, &magic, &error_msg)); in MaybeDex() local
170 if (fd.get() == -1) { in MaybeDex()
174 return ContainsClassesDex(fd.release(), filename); in MaybeDex()
211 std::unique_ptr<const DexFile> DexFile::OpenFile(int fd, const char* location, bool verify, in OpenFile() argument
216 ScopedFd delayed_close(fd); in OpenFile()
219 if (fstat(fd, &sbuf) == -1) { in OpenFile()
228 map.reset(MemMap::MapFile(length, PROT_READ, MAP_PRIVATE, fd, 0, location, error_msg)); in OpenFile()
261 bool DexFile::OpenZip(int fd, const std::string& location, std::string* error_msg, in OpenZip() argument
264 std::unique_ptr<ZipArchive> zip_archive(ZipArchive::OpenFromFd(fd, location.c_str(), error_msg)); in OpenZip()