Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 71) sorted by relevance

123

/art/libartbase/base/
Dfile_magic.cc34 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()
Dmemfd_test.cc23 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()
Dzip_archive.cc213 static void SetCloseOnExec(int fd) { in SetCloseOnExec() argument
216 UNUSED(fd); in SetCloseOnExec()
220 int flags = fcntl(fd, F_GETFD); in SetCloseOnExec()
222 PLOG(WARNING) << "fcntl(" << fd << ", F_GETFD) failed"; in SetCloseOnExec()
225 int rc = fcntl(fd, F_SETFD, flags | FD_CLOEXEC); in SetCloseOnExec()
227 PLOG(WARNING) << "fcntl(" << fd << ", F_SETFD, " << flags << ") failed"; in SetCloseOnExec()
248 ZipArchive* ZipArchive::OpenFromFd(int fd, const char* filename, std::string* error_msg) { in OpenFromFd() argument
250 DCHECK_GT(fd, 0); in OpenFromFd()
253 const int32_t error = OpenArchiveFd(fd, filename, &handle); in OpenFromFd()
Dscoped_flock.h57 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()
Dmem_map_unix.cc27 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()
Dsocket_peer_is_trusted.cc30 bool SocketPeerIsTrusted(int fd) { in SocketPeerIsTrusted() argument
33 if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_length) != 0) { in SocketPeerIsTrusted()
Dmemfd.cc104 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()
Dzip_archive_test.cc53 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()
Dmem_map.h183 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/
DOpenjdkJvm.cc81 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/
Djit_memory_region_test.cc62 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 …]
Djit_memory_region.cc516 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/
Dprofile_boot_info.cc41 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()
Dprofile_boot_info.h44 bool Save(int fd) const;
48 bool Load(int fd, const std::vector<const DexFile*>& dex_files);
Dprofile_helpers.h29 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/libdexfile/dex/
Dart_dex_file_loader.cc95 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 …]
Dart_dex_file_loader.h83 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/libnativebridge/tests/
DCodeCacheStatFail_test.cpp29 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/libartbase/base/unix_file/
Dfd_file.cc70 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 …]
Dfd_file.h40 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/
Ddex_file_supp_test.cc139 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/
Dmonitor_android.cc46 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/
Dpalette_fake.cc81 int* fd) { in PaletteAshmemCreateRegion() argument
82 *fd = -1; in PaletteAshmemCreateRegion()
86 enum PaletteStatus PaletteAshmemSetProtRegion(int fd ATTRIBUTE_UNUSED, in PaletteAshmemSetProtRegion()
/art/libartpalette/apex/
Dpalette.cc154 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/
Dprofman.cc77 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 …]

123