Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 64) 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.cc205 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()
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()
Dmem_map.h184 int fd, in MapFile() argument
193 fd, in MapFile()
218 int fd,
283 int fd,
348 int fd,
355 int fd,
399 int fd,
404 static void* TargetMMap(void* start, size_t len, int prot, int flags, int fd, off_t fd_off);
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()
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()
Dscoped_flock.cc103 ScopedFlock LockedFile::DupOf(const int fd, const std::string& path, in DupOf() argument
107 UNUSED(fd); in DupOf()
119 new LockedFile(DupCloexec(fd), path, /* check_usage= */ false, read_only_mode)); in DupOf()
Dmem_map_windows.cc45 void* MemMap::TargetMMap(void* start, size_t len, int prot, int flags, int fd, off_t fd_off) { in TargetMMap() argument
88 HANDLE file_handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd)); in TargetMMap()
101 HANDLE handle = ::CreateFileMapping(reinterpret_cast<HANDLE>(_get_osfhandle(fd)), in TargetMMap()
/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/jdwp/
Djdwp_adb.cc350 int fd; in ProcessIncoming() local
355 fd = ControlSock(); in ProcessIncoming()
356 if (fd >= 0) { in ProcessIncoming()
357 FD_SET(fd, &readfds); in ProcessIncoming()
358 if (maxfd < fd) { in ProcessIncoming()
359 maxfd = fd; in ProcessIncoming()
362 fd = clientSock; in ProcessIncoming()
363 if (fd >= 0) { in ProcessIncoming()
364 FD_SET(fd, &readfds); in ProcessIncoming()
365 if (maxfd < fd) { in ProcessIncoming()
[all …]
Djdwp_socket.cc202 static int SetNoDelay(int fd) { in SetNoDelay() argument
204 int cc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); in SetNoDelay()
390 int fd; in ProcessIncoming() local
395 fd = listenSock; in ProcessIncoming()
396 if (fd >= 0) { in ProcessIncoming()
397 FD_SET(fd, &readfds); in ProcessIncoming()
398 if (maxfd < fd) { in ProcessIncoming()
399 maxfd = fd; in ProcessIncoming()
402 fd = clientSock; in ProcessIncoming()
403 if (fd >= 0) { in ProcessIncoming()
[all …]
/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/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/compiler/utils/mips64/
Dassembler_mips64.cc164 void Mips64Assembler::EmitFR(int opcode, int fmt, FpuRegister ft, FpuRegister fs, FpuRegister fd, in EmitFR() argument
168 CHECK_NE(fd, kNoFpuRegister); in EmitFR()
173 static_cast<uint32_t>(fd) << kFdShift | in EmitFR()
977 void Mips64Assembler::AddS(FpuRegister fd, FpuRegister fs, FpuRegister ft) { in AddS() argument
978 EmitFR(0x11, 0x10, ft, fs, fd, 0x0); in AddS()
981 void Mips64Assembler::SubS(FpuRegister fd, FpuRegister fs, FpuRegister ft) { in SubS() argument
982 EmitFR(0x11, 0x10, ft, fs, fd, 0x1); in SubS()
985 void Mips64Assembler::MulS(FpuRegister fd, FpuRegister fs, FpuRegister ft) { in MulS() argument
986 EmitFR(0x11, 0x10, ft, fs, fd, 0x2); in MulS()
989 void Mips64Assembler::DivS(FpuRegister fd, FpuRegister fs, FpuRegister ft) { in DivS() argument
[all …]
Dassembler_mips64.h580 void AddS(FpuRegister fd, FpuRegister fs, FpuRegister ft);
581 void SubS(FpuRegister fd, FpuRegister fs, FpuRegister ft);
582 void MulS(FpuRegister fd, FpuRegister fs, FpuRegister ft);
583 void DivS(FpuRegister fd, FpuRegister fs, FpuRegister ft);
584 void AddD(FpuRegister fd, FpuRegister fs, FpuRegister ft);
585 void SubD(FpuRegister fd, FpuRegister fs, FpuRegister ft);
586 void MulD(FpuRegister fd, FpuRegister fs, FpuRegister ft);
587 void DivD(FpuRegister fd, FpuRegister fs, FpuRegister ft);
588 void SqrtS(FpuRegister fd, FpuRegister fs);
589 void SqrtD(FpuRegister fd, FpuRegister fs);
[all …]
/art/compiler/utils/mips/
Dassembler_mips.cc306 FRegister fd, in EmitFR() argument
310 CHECK_NE(fd, kNoFRegister); in EmitFR()
315 static_cast<uint32_t>(fd) << kFdShift | in EmitFR()
1226 void MipsAssembler::AddS(FRegister fd, FRegister fs, FRegister ft) { in AddS() argument
1227 DsFsmInstr(EmitFR(0x11, 0x10, ft, fs, fd, 0x0)).FprOuts(fd).FprIns(fs, ft); in AddS()
1230 void MipsAssembler::SubS(FRegister fd, FRegister fs, FRegister ft) { in SubS() argument
1231 DsFsmInstr(EmitFR(0x11, 0x10, ft, fs, fd, 0x1)).FprOuts(fd).FprIns(fs, ft); in SubS()
1234 void MipsAssembler::MulS(FRegister fd, FRegister fs, FRegister ft) { in MulS() argument
1235 DsFsmInstr(EmitFR(0x11, 0x10, ft, fs, fd, 0x2)).FprOuts(fd).FprIns(fs, ft); in MulS()
1238 void MipsAssembler::DivS(FRegister fd, FRegister fs, FRegister ft) { in DivS() argument
[all …]
Dassembler_mips.h439 void AddS(FRegister fd, FRegister fs, FRegister ft);
440 void SubS(FRegister fd, FRegister fs, FRegister ft);
441 void MulS(FRegister fd, FRegister fs, FRegister ft);
442 void DivS(FRegister fd, FRegister fs, FRegister ft);
443 void AddD(FRegister fd, FRegister fs, FRegister ft);
444 void SubD(FRegister fd, FRegister fs, FRegister ft);
445 void MulD(FRegister fd, FRegister fs, FRegister ft);
446 void DivD(FRegister fd, FRegister fs, FRegister ft);
447 void SqrtS(FRegister fd, FRegister fs);
448 void SqrtD(FRegister fd, FRegister fs);
[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/profman/
Dprofman.cc73 static bool FdIsValid(int fd) { in FdIsValid() argument
74 return fd != kInvalidFd; in FdIsValid()
515 std::unique_ptr<const ProfileCompilationInfo> LoadProfile(const std::string& filename, int fd) { in LoadProfile() argument
522 fd = open(filename.c_str(), flags); in LoadProfile()
523 if (fd < 0) { in LoadProfile()
529 if (!info->Load(fd)) { in LoadProfile()
530 LOG(ERROR) << "Cannot load profile info from fd=" << fd << "\n"; in LoadProfile()
538 int fd, in DumpOneProfile() argument
541 std::unique_ptr<const ProfileCompilationInfo> info(LoadProfile(filename, fd)); in DumpOneProfile()
543 LOG(ERROR) << "Cannot load profile info from filename=" << filename << " fd=" << fd; in DumpOneProfile()
[all …]
/art/dt_fd_forward/
Ddt_fd_forward.cc106 static void SendListenMessage(const android::base::unique_fd& fd) { in SendListenMessage() argument
107 TEMP_FAILURE_RETRY(send(fd, kListenStartMessage, sizeof(kListenStartMessage), MSG_EOR)); in SendListenMessage()
111 static int DupCloexec(int fd) { in DupCloexec() argument
113 return fcntl(fd, F_DUPFD_CLOEXEC, 0); in DupCloexec()
115 return dup(fd); in DupCloexec()
131 static void SendListenEndMessage(const android::base::unique_fd& fd) { in SendListenEndMessage() argument
132 TEMP_FAILURE_RETRY(send(fd, kListenEndMessage, sizeof(kListenEndMessage), MSG_EOR)); in SendListenEndMessage()
247 explicit ScopedEventFdLock(const android::base::unique_fd& fd) : fd_(fd), data_(0) { in ScopedEventFdLock() argument
286 static void SendAcceptMessage(int fd) { in SendAcceptMessage() argument
287 TEMP_FAILURE_RETRY(send(fd, kAcceptMessage, sizeof(kAcceptMessage), MSG_EOR)); in SendAcceptMessage()
[all …]

123