Collaboration diagram for Mmapping:

Public Member Functions

 Mmapping (int fd, size_t length, int prot, int flags, off_t offset)
 
 ~Mmapping ()
 
void * map ()
 calls mmap(2); returns usable buffer or nil on failure More...
 
bool unmap ()
 unmaps previously mapped buffer, if any More...
 

Private Attributes

const int fd
 descriptor of the mmapped file More...
 
const size_t length
 user-requested data length, needed for munmap More...
 
const int prot
 mmap(2) "protection" flags More...
 
const int flags
 other mmap(2) flags More...
 
const off_t offset
 user-requested data offset More...
 
off_t delta
 mapped buffer increment to hit user offset More...
 
void * buf
 buffer returned by mmap, needed for munmap More...
 

Detailed Description

Definition at line 36 of file MmappedFile.cc.

Constructor & Destructor Documentation

◆ Mmapping()

Mmapping::Mmapping ( int  fd,
size_t  length,
int  prot,
int  flags,
off_t  offset 
)

Definition at line 220 of file MmappedFile.cc.

◆ ~Mmapping()

Mmapping::~Mmapping ( )

Definition at line 226 of file MmappedFile.cc.

References buf, and unmap().

Member Function Documentation

◆ map()

void * Mmapping::map ( )

Definition at line 233 of file MmappedFile.cc.

References buf, debugs, delta, fd, flags, length, offset, prot, and xstrerr().

Referenced by MmappedFile::read().

◆ unmap()

bool Mmapping::unmap ( )

Definition at line 253 of file MmappedFile.cc.

References buf, debugs, delta, error(), fd, length, and xstrerr().

Referenced by ~Mmapping(), and MmappedFile::read().

Member Data Documentation

◆ buf

void* Mmapping::buf
private

Definition at line 53 of file MmappedFile.cc.

Referenced by ~Mmapping(), map(), and unmap().

◆ delta

off_t Mmapping::delta
private

Definition at line 52 of file MmappedFile.cc.

Referenced by map(), and unmap().

◆ fd

const int Mmapping::fd
private

Definition at line 46 of file MmappedFile.cc.

Referenced by map(), and unmap().

◆ flags

const int Mmapping::flags
private

Definition at line 49 of file MmappedFile.cc.

Referenced by map().

◆ length

const size_t Mmapping::length
private

Definition at line 47 of file MmappedFile.cc.

Referenced by map(), and unmap().

◆ offset

const off_t Mmapping::offset
private

Definition at line 50 of file MmappedFile.cc.

Referenced by map().

◆ prot

const int Mmapping::prot
private

Definition at line 48 of file MmappedFile.cc.

Referenced by map().


The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors