Lines Matching refs:fd_

40     : guard_state_(GuardState::kClosed), fd_(-1), auto_close_(true), read_only_mode_(false) {  in FdFile()
45 fd_(fd), auto_close_(true), read_only_mode_(false) { in FdFile()
54 fd_(fd), file_path_(path), auto_close_(true), read_only_mode_(read_only_mode) { in FdFile()
58 : fd_(-1), auto_close_(true) { in FdFile()
75 if (auto_close_ && fd_ != -1) { in Destroy()
77 PLOG(WARNING) << "Failed to close file with fd=" << fd_ << " path=" << file_path_; in Destroy()
87 if (this->fd_ != other.fd_) { in operator =()
92 fd_ = other.fd_; in operator =()
138 DCHECK_EQ(fd_, -1) << path; in Open()
140 fd_ = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); in Open()
141 if (fd_ == -1) { in Open()
157 int result = close(fd_); in Close()
175 fd_ = -1; in Close()
184 int rc = TEMP_FAILURE_RETRY(fdatasync(fd_)); in Flush()
186 int rc = TEMP_FAILURE_RETRY(fsync(fd_)); in Flush()
200 int rc = TEMP_FAILURE_RETRY(pread64(fd_, buf, byte_count, offset)); in Read()
202 int rc = TEMP_FAILURE_RETRY(pread(fd_, buf, byte_count, offset)); in Read()
210 int rc = TEMP_FAILURE_RETRY(ftruncate64(fd_, new_length)); in SetLength()
212 int rc = TEMP_FAILURE_RETRY(ftruncate(fd_, new_length)); in SetLength()
220 int rc = TEMP_FAILURE_RETRY(fstat(fd_, &s)); in GetLength()
227 int rc = TEMP_FAILURE_RETRY(pwrite64(fd_, buf, byte_count, offset)); in Write()
229 int rc = TEMP_FAILURE_RETRY(pwrite(fd_, buf, byte_count, offset)); in Write()
236 return fd_; in Fd()
248 return fd_ >= 0; in IsOpened()
274 return ReadFullyGeneric<ReadIgnoreOffset>(fd_, buffer, byte_count, 0); in ReadFully()
278 return ReadFullyGeneric<pread>(fd_, buffer, byte_count, offset); in PreadFully()
289 ? TEMP_FAILURE_RETRY(pwrite(fd_, ptr, byte_count, offset)) in WriteFullyGeneric()
290 : TEMP_FAILURE_RETRY(write(fd_, ptr, byte_count)); in WriteFullyGeneric()
368 if (fstat(fd_, &this_stat) == 0 && fstat(cur_fd, &current_stat) == 0) { in Unlink()
445 off_t rc = TEMP_FAILURE_RETRY(lseek(fd_, 0, SEEK_SET)); in ResetOffset()