1 /* 2 * Copyright (c) 1982, 1986 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 * 6 * %sccs.include.redist.c% 7 * 8 * @(#)mman.h 7.2 (Berkeley) 12/05/90 9 */ 10 11 /* 12 * Protections are chosen from these bits, or-ed together 13 */ 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 18 /* 19 * Flags contain mapping type, sharing type and options. 20 * Mapping type; choose one 21 */ 22 #define MAP_FILE 0x0001 /* mapped from a file or device */ 23 #define MAP_ANON 0x0002 /* allocated from memory, swap space */ 24 #define MAP_TYPE 0x000f /* mask for type field */ 25 26 /* 27 * Sharing types; choose one 28 */ 29 #define MAP_COPY 0x0020 /* "copy" region at mmap time */ 30 #define MAP_SHARED 0x0010 /* share changes */ 31 #define MAP_PRIVATE 0x0000 /* changes are private */ 32 33 /* 34 * Other flags 35 */ 36 #define MAP_FIXED 0x0100 /* map addr must be exactly as requested */ 37 #define MAP_NOEXTEND 0x0200 /* for MAP_FILE, don't change file size */ 38 #define MAP_HASSEMPHORE 0x0400 /* region may contain semaphores */ 39 #define MAP_INHERIT 0x0800 /* region is retained after exec */ 40 41 /* 42 * Advice to madvise 43 */ 44 #define MADV_NORMAL 0 /* no further special treatment */ 45 #define MADV_RANDOM 1 /* expect random page references */ 46 #define MADV_SEQUENTIAL 2 /* expect sequential page references */ 47 #define MADV_WILLNEED 3 /* will need these pages */ 48 #define MADV_DONTNEED 4 /* dont need these pages */ 49