/[LeafOK_CVS]/lbbs/src/file_loader.c
ViewVC logotype

Diff of /lbbs/src/file_loader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Fri May 16 12:22:35 2025 UTC Revision 1.2 by sysadm, Fri May 16 14:09:31 2025 UTC
# Line 25  Line 25 
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;
# Line 118  int load_file_mmap(const char *filename) Line 116  int load_file_mmap(const char *filename)
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);


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1