| 25 |
#include <sys/mman.h> |
#include <sys/mman.h> |
| 26 |
#include <sys/stat.h> |
#include <sys/stat.h> |
| 27 |
|
|
|
#define FILE_MMAP_COUNT_LIMIT 256 |
|
|
|
|
| 28 |
static FILE_MMAP *p_file_mmap_pool = NULL; |
static FILE_MMAP *p_file_mmap_pool = NULL; |
| 29 |
static int file_mmap_count = 0; |
static int file_mmap_count = 0; |
| 30 |
static int file_mmap_free_index = -1; |
static int file_mmap_free_index = -1; |
| 116 |
|
|
| 117 |
size = (size_t)sb.st_size; |
size = (size_t)sb.st_size; |
| 118 |
|
|
| 119 |
p_data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0L); |
p_data = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0L); |
| 120 |
if (p_data == MAP_FAILED) |
if (p_data == MAP_FAILED) |
| 121 |
{ |
{ |
| 122 |
log_error("mmap() error (%d)\n", errno); |
log_error("mmap() error (%d)\n", errno); |