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

/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
21 years ago
#ifndef MMAP_H
#define MMAP_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
21 years ago
/* open file for reading, mmap whole file, close file, write length of
* map in filesize and return pointer to map. */
const char* mmap_read(const char *filename,size_t* filesize);
21 years ago
5 years ago
/* like mmap_read but use openat instead of open */
const char* mmap_readat(const char *filename,size_t* filesize,int dirfd);
/* open file for reading, mmap whole file privately (copy on write),
21 years ago
* close file, write length of map in filesize and return pointer to
* map. */
char* mmap_private(const char *filename,size_t* filesize);
21 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);
21 years ago
/* unmap a mapped region */
int mmap_unmap(const char* mapped,size_t maplen);
#ifdef __cplusplus
}
#endif
21 years ago
#endif