Home
last modified time | relevance | path

Searched refs:fd_ (Results 1 – 25 of 32) sorted by relevance

12

/system/update_engine/payload_consumer/
Dfile_descriptor.cc32 CHECK_EQ(fd_, -1); in Open()
33 return ((fd_ = HANDLE_EINTR(open(path, flags, mode))) >= 0); in Open()
37 CHECK_EQ(fd_, -1); in Open()
38 return ((fd_ = HANDLE_EINTR(open(path, flags))) >= 0); in Open()
42 CHECK_GE(fd_, 0); in Read()
43 return HANDLE_EINTR(read(fd_, buf, count)); in Read()
47 CHECK_GE(fd_, 0); in Write()
53 ssize_t ret = HANDLE_EINTR(write(fd_, char_buf, count)); in Write()
66 CHECK_GE(fd_, 0); in Seek()
67 return lseek64(fd_, offset, whence); in Seek()
[all …]
Dfile_writer.cc24 CHECK_EQ(fd_, -1); in Open()
25 fd_ = open(path, flags, mode); in Open()
26 if (fd_ < 0) in Open()
32 CHECK_GE(fd_, 0); in Write()
37 ssize_t rc = write(fd_, char_bytes + bytes_written, in Write()
48 CHECK_GE(fd_, 0); in Close()
49 int rc = close(fd_); in Close()
53 fd_ = -2; in Close()
Dbzip_extent_writer_unittest.cc44 fd_.reset(new EintrSafeFileDescriptor); in SetUp()
45 ASSERT_TRUE(fd_->Open(temp_file_.path().c_str(), O_RDWR, 0600)); in SetUp()
48 fd_->Close(); in TearDown()
53 FileDescriptorPtr fd_; member in chromeos_update_engine::BzipExtentWriterTest
75 EXPECT_TRUE(bzip_writer.Init(fd_, extents, kBlockSize)); in TEST_F()
113 EXPECT_TRUE(bzip_writer.Init(fd_, extents, kBlockSize)); in TEST_F()
Dextent_writer_unittest.cc49 fd_.reset(new EintrSafeFileDescriptor); in SetUp()
50 ASSERT_TRUE(fd_->Open(temp_file_.path().c_str(), O_RDWR, 0600)); in SetUp()
53 fd_->Close(); in TearDown()
63 FileDescriptorPtr fd_; member in chromeos_update_engine::ExtentWriterTest
77 EXPECT_TRUE(direct_writer.Init(fd_, extents, kBlockSize)); in TEST_F()
101 EXPECT_TRUE(direct_writer.Init(fd_, extents, kBlockSize)); in TEST_F()
136 EXPECT_TRUE(direct_writer.Init(fd_, extents, kBlockSize)); in WriteAlignedExtents()
190 EXPECT_TRUE(zero_pad_writer.Init(fd_, extents, kBlockSize)); in TestZeroPad()
194 fd_->Seek(kBlockSize - missing_bytes, SEEK_SET); in TestZeroPad()
195 EXPECT_EQ(3, fd_->Write("xxx", 3)); in TestZeroPad()
[all …]
Dxz_extent_writer_unittest.cc96 EXPECT_TRUE(xz_writer_->Init(fd_, {}, 1024)); in WriteAll()
112 FileDescriptorPtr fd_; member in chromeos_update_engine::XzExtentWriterTest
143 EXPECT_TRUE(xz_writer_->Init(fd_, {}, 1024)); in TEST_F()
154 EXPECT_TRUE(xz_writer_->Init(fd_, {}, 1024)); in TEST_F()
Dfile_descriptor.h118 EintrSafeFileDescriptor() : fd_(-1) {} in EintrSafeFileDescriptor()
137 return (fd_ >= 0); in IsOpen()
141 int fd_;
Dextent_writer.cc52 TEST_AND_RETURN_FALSE_ERRNO(fd_->Seek(offset, SEEK_SET) != in Write()
55 utils::WriteAll(fd_, c_bytes + bytes_written, bytes_to_write)); in Write()
Dfile_writer.h78 int fd() const { return fd_; } in fd()
81 int fd_{-1};
Dextent_writer.h71 fd_ = fd; in Init()
80 FileDescriptorPtr fd_{nullptr};
/system/tpm/trunks/
Dtpm_handle.cc36 TpmHandle::TpmHandle() : fd_(kInvalidFileDescriptor) {} in TpmHandle()
39 int result = IGNORE_EINTR(close(fd_)); in ~TpmHandle()
47 if (fd_ != kInvalidFileDescriptor) { in Init()
51 fd_ = HANDLE_EINTR(open(kTpmDevice, O_RDWR)); in Init()
52 if (fd_ == kInvalidFileDescriptor) { in Init()
76 CHECK_NE(fd_, kInvalidFileDescriptor); in SendCommandInternal()
77 int result = HANDLE_EINTR(write(fd_, command.data(), command.length())); in SendCommandInternal()
88 result = HANDLE_EINTR(read(fd_, response_buf, kTpmBufferSize)); in SendCommandInternal()
/system/core/libmemunreachable/
DLeakPipe.h78 LeakPipeBase() : fd_(-1) {} in LeakPipeBase()
85 fd_ = fd; in SetFd()
89 close(fd_); in Close()
90 fd_ = -1; in Close()
94 int fd_;
106 ssize_t ret = TEMP_FAILURE_RETRY(write(fd_, &value, sizeof(T))); in Send()
125 ssize_t ret = TEMP_FAILURE_RETRY(write(fd_, vector.data(), size)); in SendVector()
144 ssize_t ret = TEMP_FAILURE_RETRY(read(fd_, reinterpret_cast<void*>(value), sizeof(T))); in Receive()
167 ssize_t ret = TEMP_FAILURE_RETRY(read(fd_, ptr, size)); in ReceiveVector()
DLineBuffer.cpp26 LineBuffer::LineBuffer(int fd, char* buffer, size_t buffer_len) : fd_(fd), buffer_(buffer), buffer_… in LineBuffer()
47 ssize_t bytes = TEMP_FAILURE_RETRY(read(fd_, buffer_ + bytes_, buffer_len_ - bytes_ - 1)); in GetLine()
DLineBuffer.h29 int fd_;
/system/core/adb/
Dshell_service_protocol.cpp25 ShellProtocol::ShellProtocol(int fd) : fd_(fd) { in ShellProtocol()
35 if (!ReadFdExactly(fd_, buffer_, kHeaderSize)) { in Read()
46 if (read_length && !ReadFdExactly(fd_, data(), read_length)) { in Read()
61 return WriteFdExactly(fd_, buffer_, kHeaderSize + length); in Write()
/system/core/libziparchive/
Dzip_writer_test.cc32 int fd_; member
37 fd_ = temp_file_->fd; in SetUp()
38 file_ = fdopen(fd_, "w"); in SetUp()
59 ASSERT_GE(0, lseek(fd_, 0, SEEK_SET)); in TEST_F()
62 ASSERT_EQ(0, OpenArchiveFd(fd_, "temp", &handle, false)); in TEST_F()
91 ASSERT_GE(0, lseek(fd_, 0, SEEK_SET)); in TEST_F()
94 ASSERT_EQ(0, OpenArchiveFd(fd_, "temp", &handle, false)); in TEST_F()
126 ASSERT_GE(0, lseek(fd_, 0, SEEK_SET)); in TEST_F()
129 ASSERT_EQ(0, OpenArchiveFd(fd_, "temp", &handle, false)); in TEST_F()
171 ASSERT_GE(0, lseek(fd_, 0, SEEK_SET)); in TEST_F()
[all …]
Dzip_archive_private.h34 fd_(fd), in MappedZipFile()
41 fd_(-1), in MappedZipFile()
67 const int fd_; variable
/system/extras/simpleperf/
DUnixSocket.cpp111 read_event_ = loop.AddReadEvent(fd_, [&]() { return ReadData(); }); in PrepareForIO()
116 write_event_ = loop.AddWriteEvent(fd_, [&]() { return WriteData(); }); in PrepareForIO()
134 TEMP_FAILURE_RETRY(send(fd_, write_data, write_data_size, MSG_NOSIGNAL)); in WriteData()
164 TEMP_FAILURE_RETRY(read(fd_, &read_buffer_[read_buffer_size_], in ReadData()
221 close(fd_); in CloseConnection()
222 fd_ = -1; in CloseConnection()
227 if (fd_ != -1) { in ~UnixSocketConnection()
231 close(fd_); in ~UnixSocketConnection()
Dutils.h68 fd_ = other.fd_; in FileHelper()
69 other.fd_ = -1; in FileHelper()
75 return fd_ != -1;
79 return fd_; in fd()
83 explicit FileHelper(int fd) : fd_(fd) {} in FileHelper()
84 int fd_; variable
DUnixSocket.h139 : fd_(fd), in UnixSocketConnection()
154 return fd_ == -1; in IsClosed()
221 int fd_; variable
/system/core/libappfuse/
DFuseAppLoop.cc134 FuseAppLoop::FuseAppLoop(base::unique_fd&& fd) : fd_(std::move(fd)) {} in FuseAppLoop()
151 return response.Write(fd_); in ReplySimple()
163 return response.Write(fd_); in ReplyLookup()
174 return response.Write(fd_); in ReplyGetAttr()
181 return response.Write(fd_); in ReplyOpen()
189 return response.Write(fd_); in ReplyWrite()
196 return response.WriteWithBody(fd_, sizeof(FuseResponse), data); in ReplyRead()
216 if (!epoll_controller->AddFd(fd_, EPOLLIN, &last_event)) { in Start()
239 if (!HandleMessage(this, &buffer, fd_, callback)) { in Start()
/system/extras/memory_replay/
DLineBuffer.cpp23 LineBuffer::LineBuffer(int fd, char* buffer, size_t buffer_len) : fd_(fd), buffer_(buffer), buffer_… in LineBuffer()
44 ssize_t bytes = TEMP_FAILURE_RETRY(read(fd_, buffer_ + bytes_, buffer_len_ - bytes_ - 1)); in GetLine()
DLineBuffer.h29 int fd_;
/system/update_engine/common/
Dutils.h333 explicit ScopedFdCloser(int* fd) : fd_(fd) {} in ScopedFdCloser()
335 if (should_close_ && fd_ && (*fd_ >= 0) && !IGNORE_EINTR(close(*fd_))) in ~ScopedFdCloser()
336 *fd_ = -1; in ~ScopedFdCloser()
340 int* fd_;
/system/update_engine/payload_generator/
Dfull_update_generator.cc57 fd_(fd), in ChunkProcessor()
78 int fd_; member in chromeos_update_engine::__anonfb5e7ce80111::ChunkProcessor
98 TEST_AND_RETURN_FALSE(utils::PReadAll(fd_, in ProcessChunk()
/system/extras/memtrack/
Dmemtrack.cpp39 fd_ = open(filename, O_RDONLY); in FileData()
40 if (fd_ < 0) { in FileData()
46 if (fd_ >= 0) { in ~FileData()
47 close(fd_); in ~FileData()
69 bytes = read(fd_, data_ + len_, max_ - len_); in isAvail()

12