Lines Matching defs:fd
31 std::string FileUtils::ReadFile(int fd)
39 ssize_t nBytes = TEMP_FAILURE_RETRY(read(fd, &content[count], content.size() - count));
57 int fd = open(realPath, O_RDONLY);
58 if (fd == -1) {
65 std::string content = ReadFile(fd);
66 CHECK_TRUE(close(fd) != -1, content, "close %s failed, %d", path.c_str(), errno);
99 int fd = open(path.c_str(), flags, mode);
100 CHECK_TRUE(fd >= 0, -1, "open %s failed, %d", path.c_str(), errno);
102 int retval = write(fd, content.data(), content.size());
103 CHECK_TRUE(close(fd) != -1, -1, "close %s failed, %d", path.c_str(), errno);