Lines Matching refs:fd_
26 FdFile::FdFile() : fd_(-1), auto_close_(true) {
29 FdFile::FdFile(int fd) : fd_(fd), auto_close_(true) {
32 FdFile::FdFile(int fd, const std::string& path) : fd_(fd), file_path_(path), auto_close_(true) {
37 if (auto_close_ && fd_ != -1) {
51 CHECK_EQ(fd_, -1) << path;
52 fd_ = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode));
53 if (fd_ == -1) {
61 int result = TEMP_FAILURE_RETRY(close(fd_));
65 fd_ = -1;
72 int rc = TEMP_FAILURE_RETRY(fdatasync(fd_));
77 int rc = TEMP_FAILURE_RETRY(pread64(fd_, buf, byte_count, offset));
82 int rc = TEMP_FAILURE_RETRY(ftruncate64(fd_, new_length));
88 int rc = TEMP_FAILURE_RETRY(fstat(fd_, &s));
93 int rc = TEMP_FAILURE_RETRY(pwrite64(fd_, buf, byte_count, offset));
98 return fd_;
102 return fd_ >= 0;
112 int bytes_read = TEMP_FAILURE_RETRY(read(fd_, ptr, byte_count));
125 int bytes_read = TEMP_FAILURE_RETRY(write(fd_, ptr, byte_count));