Restore the "GPL licensing not permitted" in GLUT license headers.
[haiku.git] / headers / posix / sys / mman.h
bloba69991ac05a6e5110982729cf09a693f0c898de3
1 /*
2 * Copyright 2008-2012 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
9 #include <sys/cdefs.h>
10 #include <sys/types.h>
13 /* memory protection for mmap() and others; assignment compatible with
14 B_{READ,WRITE,EXECUTE}_AREA */
15 #define PROT_READ 0x01
16 #define PROT_WRITE 0x02
17 #define PROT_EXEC 0x04
18 #define PROT_NONE 0x00
20 /* mmap() flags */
21 #define MAP_SHARED 0x01 /* changes are seen by others */
22 #define MAP_PRIVATE 0x02 /* changes are only seen by caller */
23 #define MAP_FIXED 0x04 /* require mapping to specified addr */
24 #define MAP_ANONYMOUS 0x08 /* no underlying object */
25 #define MAP_ANON MAP_ANONYMOUS
27 /* mmap() error return code */
28 #define MAP_FAILED ((void*)-1)
30 /* msync() flags */
31 #define MS_ASYNC 0x01
32 #define MS_SYNC 0x02
33 #define MS_INVALIDATE 0x04
35 /* posix_madvise() values */
36 #define POSIX_MADV_NORMAL 1
37 #define POSIX_MADV_SEQUENTIAL 2
38 #define POSIX_MADV_RANDOM 3
39 #define POSIX_MADV_WILLNEED 4
40 #define POSIX_MADV_DONTNEED 5
43 __BEGIN_DECLS
45 void* mmap(void* address, size_t length, int protection, int flags,
46 int fd, off_t offset);
47 int munmap(void* address, size_t length);
49 int mprotect(void* address, size_t length, int protection);
50 int msync(void* address, size_t length, int flags);
52 int posix_madvise(void* address, size_t length, int advice);
54 int shm_open(const char* name, int openMode, mode_t permissions);
55 int shm_unlink(const char* name);
57 __END_DECLS
60 #endif /* _SYS_MMAN_H */