16 #if FOXXLL_HAVE_MMAP_FILE 26 void mmap_file::serve(
void* buffer, offset_type offset, size_type
bytes,
29 std::unique_lock<std::mutex> fd_lock(fd_mutex_);
33 file_stats::scoped_read_write_timer read_write_timer(
37 void* mem = mmap(
nullptr, bytes, prot, MAP_SHARED, file_des_, offset);
39 if (mem == MAP_FAILED)
44 " path=" << filename_ <<
46 " Page size: " << sysconf(_SC_PAGESIZE) <<
47 " offset modulo page size " << (offset % sysconf(_SC_PAGESIZE))
58 memcpy(buffer, mem, bytes);
62 memcpy(mem, buffer, bytes);
65 munmap(mem, bytes), io_error,
71 const char* mmap_file::io_type()
const 78 #endif // #if FOXXLL_HAVE_MMAP_FILE
#define FOXXLL_THROW_ERRNO(exception_type, error_message)
Throws exception_type with "Error in [function] : [error_message] : [errno message]".
static const size_t bytes
number of bytes in uint_pair
#define FOXXLL_THROW_ERRNO_NE_0(expr, exception_type, error_message)
Throws exception_type if (expr != 0) with "Error in [function] : [error_message] : [errno message]"...