NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
mmapfd.c File Reference
#include "mmapfd.h"
#include "logger.h"
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>

Macros

#define MmapFd_Error(func)   N_LOGE("%s(%s,fd=%d)" N_LOG_ERROR_ERRNO, #func, filename, m->fd, errno)
 

Functions

 N_LOG_INIT (MmapFd)
 
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...
 

Macro Definition Documentation

◆ MmapFd_Error

#define MmapFd_Error (   func)    N_LOGE("%s(%s,fd=%d)" N_LOG_ERROR_ERRNO, #func, filename, m->fd, errno)

Function Documentation

◆ 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.

◆ N_LOG_INIT()

N_LOG_INIT ( MmapFd  )