You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
704 B
C

24 years ago
#ifndef MMAP_H
#define MMAP_H
#include <stddef.h>
24 years ago
/* open file for reading, mmap whole file, close file, write length of
* map in filesize and return pointer to map. */
char* mmap_read(const char *filename,size_t* filesize);
24 years ago
/* open file for writing, mmap whole file privately (copy on write),
* close file, write length of map in filesize and return pointer to
* map. */
char* mmap_private(const char *filename,size_t* filesize);
24 years ago
/* open file for writing, mmap whole file shared, close file, write
* length of map in filesize and return pointer to map. */
char* mmap_shared(const char *filename,size_t* filesize);
24 years ago
/* unmap a mapped region */
int mmap_unmap(char* mapped,size_t maplen);
24 years ago
#endif