xref: /haiku/headers/posix/sys/mman.h (revision fc1ca2da5cfcb00ffdf791606d5ae97fdd58a638)
1 /*
2  * Copyright 2008, Haiku Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _SYS_MMAN_H
6 #define _SYS_MMAN_H
7 
8 #include <sys/types.h>
9 
10 
11 // memory protection for mmap() and others
12 #define PROT_READ		0x01
13 #define PROT_WRITE		0x02
14 #define PROT_EXEC		0x04
15 #define PROT_NONE		0x00
16 
17 // mmap() flags
18 #define MAP_SHARED		0x01			/* changes are seen by others */
19 #define MAP_PRIVATE		0x02			/* changes are only seen by caller */
20 #define MAP_FIXED		0x04			/* require mapping to specified addr */
21 #define MAP_ANONYMOUS	0x08			/* no underlying object */
22 #define MAP_ANON		MAP_ANONYMOUS
23 
24 // mmap() error return code
25 #define MAP_FAILED		((void*)-1)
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 extern void*	mmap(void* address, size_t length, int protection, int flags,
33 					int fd, off_t offset);
34 extern int		munmap(void* address, size_t length);
35 
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 
41 
42 #endif	// _SYS_MMAN_H
43