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.
 
 
 
 

35 lines
985 B

  1. /* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
  2. #ifndef MMAP_H
  3. #define MMAP_H
  4. #include <stddef.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /* open file for reading, mmap whole file, close file, write length of
  9. * map in filesize and return pointer to map. */
  10. const char* mmap_read(const char *filename,size_t* filesize);
  11. /* like mmap_read but use openat instead of open */
  12. const char* mmap_readat(const char *filename,size_t* filesize,int dirfd);
  13. /* open file for writing, mmap whole file privately (copy on write),
  14. * close file, write length of map in filesize and return pointer to
  15. * map. */
  16. char* mmap_private(const char *filename,size_t* filesize);
  17. /* open file for writing, mmap whole file shared, close file, write
  18. * length of map in filesize and return pointer to map. */
  19. char* mmap_shared(const char *filename,size_t* filesize);
  20. /* unmap a mapped region */
  21. int mmap_unmap(const char* mapped,size_t maplen);
  22. #ifdef __cplusplus
  23. }
  24. #endif
  25. #endif