NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
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)

Functions

 N_LOG_INIT (MmapFd)
bool MmapFd_Open (MmapFd *m, const char *filename, size_t size)
 Create a file with memory map.
bool MmapFd_Close (MmapFd *m, const char *filename, size_t size)
 Close a file with memory map.

Macro Definition Documentation

◆ MmapFd_Error

#define MmapFd_Error ( func)
Value:
N_LOGE("%s(%s,fd=%d)" N_LOG_ERROR_ERRNO, #func, filename, m->fd, errno)
#define N_LOG_ERROR_ERRNO
Definition logger.h:32
#define N_LOGE(...)
Definition logger.h:28

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 )