Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
859 B

  1. .TH mmap_shared 3
  2. .SH NAME
  3. mmap_shared \- memory map a file for reading and writing
  4. .SH SYNTAX
  5. .B #include <mmap.h>
  6. extern char* \fBmmap_shared\fP(const char* \fIfilename\fR,unsigned long* \fIfilesize\fR);
  7. .SH DESCRIPTION
  8. mmap_shared opens \fIfilename\fR for reading and writing, maps the
  9. whole file into memory, closes the file, writes the length of the file
  10. to \fIfilesize\fR and returns a pointer to the mapped file.
  11. The file is mapped shared. Changes done to the mapped region are
  12. written to disk and are visible to other processes reading from the file
  13. or mapping the same file into memory.
  14. The file is unmapped by the operating system if the process terminates.
  15. It can also be manually unmapped by calling \fBmunmap\fR from
  16. <sys/mman.h>.
  17. To write changes to disk immediately, you can use msync from
  18. <sys/mman.h>.
  19. .SH "SEE ALSO"
  20. munmap(2), msync(2)