MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / append

Method append

src/jrd/replication/ChangeLog.cpp:214–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214void ChangeLog::Segment::append(ULONG length, const UCHAR* data)
215{
216 fb_assert(m_header != &m_builtinHeader);
217 fb_assert(m_header->hdr_state == SEGMENT_STATE_USED);
218 fb_assert(length);
219
220 const auto currentLength = (SINT64) m_header->hdr_length;
221
222 if (os_utils::lseek(m_handle, currentLength, SEEK_SET) != currentLength)
223 raiseError("Journal file %s seek failed (error %d)", m_filename.c_str(), ERRNO);
224
225 if (::write(m_handle, data, length) != length)
226 raiseError("Journal file %s write failed (error %d)", m_filename.c_str(), ERRNO);
227
228 m_header->hdr_length += length;
229}
230
231void ChangeLog::Segment::setState(SegmentState state)
232{

Callers 5

writeMethod · 0.45
checkBoundConnectionMethod · 0.45
printPoolMethod · 0.45
preprocessMethod · 0.45
print_blrMethod · 0.45

Calls 3

lseekFunction · 0.85
raiseErrorFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected