source: CIVL/include/headers/sys/mman.h@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/* sys/mman.h: Memory management declarations.
2 */
3
4#ifndef _SYSMMAN_
5#define _SYSMMAN_
6
7/* Types */
8typedef int mode_t;
9typedef long off_t;
10typedef unsigned long int size_t;
11typedef struct posix_typed_mem_info posix_typed_mem_info;
12
13/* Macros */
14#define PROT_READ 0x04 /* pages can be read */
15#define PROT_WRITE 0x02 /* pages can be written */
16#define PROT_EXEC 0x01 /* pages can be executed */
17#define PROT_NONE 0x00 /* page cannot be accessed */
18
19#define MAP_FIXED 0x0100 /* map addr must be exactly as requested */
20#define MAP_PRIVATE 0x0000 /* changes are private */
21#define MAP_SHARED 0x0010 /* share changes */
22#define MS_ASYNC 0x0800 /* perform asynchronous writes. */
23#define MS_INVALIDATE 0x0200 /* invalidate mappings. */
24#define MS_SYNC 0x0400 /* perform synchronous writes. */
25
26#define MCL_CURRENT 0x0001 /* lock currently mapped pages. */
27#define MCL_FUTURE 0x0020 /* lock pages that become mapped. */
28
29#define POSIX_MADV_NORMAL 0 /* no further special treatment */
30#define POSIX_MADV_RANDOM 1 /* expect random page refs */
31#define POSIX_MADV_SEQUENTIAL 2 /* expect sequential page refs */
32#define POSIX_MADV_WILLNEED 3 /* will need these pages */
33#define POSIX_MADV_DONTNEED 4 /* dont need these pages */
34
35#define POSIX_TYPED_MEM_ALLOCATE 5 /* allocate on mmap(). */
36#define POSIX_TYPED_MEM_ALLOCATE_CONTIG 6 /* allocate contiguously on mmap()*/
37#define POSIX_TYPED_MEM_MAP_ALLOCATABLE 7 /* map on mmap(), without affecting allocatability.*/
38
39/* Functions */
40int mlock(const void *, size_t);
41int mlockall(int);
42void *mmap(void *, size_t, int, int, int, off_t);
43int mprotect(void *, size_t, int);
44int msync(void *, size_t, int);
45int munlock(const void *, size_t);
46int munlockall(void);
47int munmap(void *, size_t);
48int posix_madvise(void *, size_t, int);
49int posix_mem_offset(const void *restrict, size_t, off_t *restrict,
50 size_t *restrict, int *restrict);
51int posix_typed_mem_get_info(int, struct posix_typed_mem_info *);
52int posix_typed_mem_open(const char *, int, int);
53int shm_open(const char *, int, mode_t);
54int shm_unlink(const char *);
55
56#endif
Note: See TracBrowser for help on using the repository browser.