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

Function db_read

src/utilities/analyse.cpp:339–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337
338
339static PAG db_read( SLONG page_number)
340{
341/**************************************
342 *
343 * d b _ r e a d
344 *
345 **************************************
346 *
347 * Functional description
348 * Read a database page.
349 *
350 **************************************/
351
352 const FB_UINT64 offset = ((FB_UINT64) page_number) * ((FB_UINT64) page_size);
353
354 if (!global_buffer)
355 global_buffer = (pag*) malloc(page_size);
356
357 if (os_utils::lseek (file, offset, 0) == -1)
358 db_error(errno);
359
360 if (read(file, global_buffer, page_size) == -1)
361 db_error(errno);
362
363 return global_buffer;
364}
365
366
367#ifndef HAVE_TIMES

Callers 1

mainFunction · 0.85

Calls 2

lseekFunction · 0.85
db_errorFunction · 0.70

Tested by

no test coverage detected