Lines Matching refs:byte_count
138 int64_t FdFile::Read(char* buf, int64_t byte_count, int64_t offset) const {
140 int rc = TEMP_FAILURE_RETRY(pread64(fd_, buf, byte_count, offset));
142 int rc = TEMP_FAILURE_RETRY(pread(fd_, buf, byte_count, offset));
163 int64_t FdFile::Write(const char* buf, int64_t byte_count, int64_t offset) {
165 int rc = TEMP_FAILURE_RETRY(pwrite64(fd_, buf, byte_count, offset));
167 int rc = TEMP_FAILURE_RETRY(pwrite(fd_, buf, byte_count, offset));
187 static bool ReadFullyGeneric(int fd, void* buffer, size_t byte_count, size_t offset) {
189 while (byte_count > 0) {
190 ssize_t bytes_read = TEMP_FAILURE_RETRY(read_func(fd, ptr, byte_count, offset));
196 byte_count -= bytes_read; // Reduce the number of remaining bytes.
203 bool FdFile::ReadFully(void* buffer, size_t byte_count) {
204 return ReadFullyGeneric<ReadIgnoreOffset>(fd_, buffer, byte_count, 0);
207 bool FdFile::PreadFully(void* buffer, size_t byte_count, size_t offset) {
208 return ReadFullyGeneric<pread>(fd_, buffer, byte_count, offset);
211 bool FdFile::WriteFully(const void* buffer, size_t byte_count) {
214 while (byte_count > 0) {
215 ssize_t bytes_written = TEMP_FAILURE_RETRY(write(fd_, ptr, byte_count));
219 byte_count -= bytes_written; // Reduce the number of remaining bytes.