NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Functions
mmapfd.h File Reference
#include "common.h"

Go to the source code of this file.

Data Structures

struct  MmapFd
 Memory map and file descriptor. More...
 

Typedefs

typedef struct MmapFd MmapFd
 Memory map and file descriptor. More...
 

Functions

bool MmapFd_Open (MmapFd *m, const char *filename, size_t size)
 Create a file with memory map. More...
 
bool MmapFd_Close (MmapFd *m, const char *filename, size_t size)
 Close a file with memory map. More...
 
__rte_always_inline void * MmapFd_At (const MmapFd *m, size_t pos)
 Access mapped memory region. More...
 

Typedef Documentation

◆ MmapFd

typedef struct MmapFd MmapFd

Memory map and file descriptor.

Function Documentation

◆ MmapFd_At()

__rte_always_inline void* MmapFd_At ( const MmapFd m,
size_t  pos 
)

Access mapped memory region.

Precondition
MmapFd_Open was successful.

◆ MmapFd_Close()

bool MmapFd_Close ( MmapFd m,
const char *  filename,
size_t  size 
)

Close a file with memory map.

Parameters
sizetruncate to final file size.
Returns
whether success.

◆ MmapFd_Open()

bool MmapFd_Open ( MmapFd m,
const char *  filename,
size_t  size 
)

Create a file with memory map.

Parameters
sizeintended file size.
Returns
whether success.