MCPcopy Create free account
hub / github.com/apache/trafficserver / RecSnapFileWrite

Function RecSnapFileWrite

src/records/RecFile.cc:111–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109//-------------------------------------------------------------------------
110
111int
112RecSnapFileWrite(RecHandle h_file, char *buf, int size, int *bytes_written)
113{
114 // First write the version byes for snap file
115 std::array<char, VERSION_HDR_SIZE> VERSION_HDR{
116 {'V', PACKAGE_VERSION[0], PACKAGE_VERSION[2], PACKAGE_VERSION[4], '\0'}
117 };
118 if (::write(h_file, VERSION_HDR.data(), VERSION_HDR_SIZE) < 0) {
119 return REC_ERR_FAIL;
120 }
121
122 if ((*bytes_written = ::pwrite(h_file, buf, size, VERSION_HDR_SIZE)) < 0) {
123 *bytes_written = 0;
124 return REC_ERR_FAIL;
125 }
126 return REC_ERR_OKAY;
127}
128
129//-------------------------------------------------------------------------
130// RecFileWrite

Callers 1

RecMessageWriteToDiskFunction · 0.85

Calls 2

writeFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected