Lines Matching defs:byte_count

154 int64_t FdFile::Read(char* buf, int64_t byte_count, int64_t offset) const {
156 int rc = TEMP_FAILURE_RETRY(pread64(fd_, buf, byte_count, offset));
158 int rc = TEMP_FAILURE_RETRY(pread(fd_, buf, byte_count, offset));
180 int64_t FdFile::Write(const char* buf, int64_t byte_count, int64_t offset) {
183 int rc = TEMP_FAILURE_RETRY(pwrite64(fd_, buf, byte_count, offset));
185 int rc = TEMP_FAILURE_RETRY(pwrite(fd_, buf, byte_count, offset));
213 static bool ReadFullyGeneric(int fd, void* buffer, size_t byte_count, size_t offset) {
215 while (byte_count > 0) {
216 ssize_t bytes_read = TEMP_FAILURE_RETRY(read_func(fd, ptr, byte_count, offset));
222 byte_count -= bytes_read; // Reduce the number of remaining bytes.
229 bool FdFile::ReadFully(void* buffer, size_t byte_count) {
230 return ReadFullyGeneric<ReadIgnoreOffset>(fd_, buffer, byte_count, 0);
233 bool FdFile::PreadFully(void* buffer, size_t byte_count, size_t offset) {
234 return ReadFullyGeneric<pread>(fd_, buffer, byte_count, offset);
238 bool FdFile::WriteFullyGeneric(const void* buffer, size_t byte_count, size_t offset) {
243 while (byte_count > 0) {
245 ? TEMP_FAILURE_RETRY(pwrite(fd_, ptr, byte_count, offset))
246 : TEMP_FAILURE_RETRY(write(fd_, ptr, byte_count));
250 byte_count -= bytes_written; // Reduce the number of remaining bytes.
257 bool FdFile::PwriteFully(const void* buffer, size_t byte_count, size_t offset) {
258 return WriteFullyGeneric<true>(buffer, byte_count, offset);
261 bool FdFile::WriteFully(const void* buffer, size_t byte_count) {
262 return WriteFullyGeneric<false>(buffer, byte_count, 0u);