MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / writeRetry

Function writeRetry

src/Client/ReplxxLineReader.cpp:110–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void writeRetry(int fd, const std::string & data)
111{
112 size_t bytes_written = 0;
113 const char * begin = data.c_str();
114 size_t offset = data.size();
115
116 while (bytes_written != offset)
117 {
118 ssize_t res = ::write(fd, begin + bytes_written, offset - bytes_written);
119 if ((-1 == res || 0 == res) && errno != EINTR)
120 throw std::runtime_error(fmt::format("Cannot write to {}: {}", fd, errnoToString()));
121 bytes_written += res;
122 }
123}
124std::string readFile(const std::string & path)
125{
126 std::string out;

Callers 1

writeMethod · 0.70

Calls 4

errnoToStringFunction · 0.85
writeFunction · 0.50
formatFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected