1mmap_private(3) Library Functions Manual mmap_private(3)
2
3
4
6 mmap_private - memory map a file for reading and writing
7
9 #include <mmap.h>
10
11 char* mmap_private(const char* filename,size_t* filesize);
12
14 mmap_private opens filename for reading and writing, maps the whole
15 file into memory, closes the file, writes the length of the file to
16 filesize and returns a pointer to the mapped file.
17
18 The file is mapped copy-on-write. Changes done to the mapped region
19 will not be written to disk.
20
21 The file is unmapped by the operating system if the process terminates.
22 It can also be manually unmapped by calling munmap from <sys/mman.h>.
23
24 If the file could not be opened or mapped, (void*)0 is returned.
25
27 mmap_unmap(3)
28
29
30
31 mmap_private(3)