mman.h revision 1817
11802Sphk/*- 21802Sphk * Copyright (c) 1982, 1986, 1993 31802Sphk * The Regents of the University of California. All rights reserved. 484211Sdillon * 584211Sdillon * Redistribution and use in source and binary forms, with or without 684211Sdillon * modification, are permitted provided that the following conditions 71802Sphk * are met: 81802Sphk * 1. Redistributions of source code must retain the above copyright 91802Sphk * notice, this list of conditions and the following disclaimer. 101802Sphk * 2. Redistributions in binary form must reproduce the above copyright 111802Sphk * notice, this list of conditions and the following disclaimer in the 121802Sphk * documentation and/or other materials provided with the distribution. 131802Sphk * 3. All advertising materials mentioning features or use of this software 141802Sphk * must display the following acknowledgement: 151802Sphk * This product includes software developed by the University of 161802Sphk * California, Berkeley and its contributors. 171802Sphk * 4. Neither the name of the University nor the names of its contributors 181802Sphk * may be used to endorse or promote products derived from this software 191802Sphk * without specific prior written permission. 201802Sphk * 211802Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221802Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231802Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241802Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251802Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261802Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271802Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2819099Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2919099Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301802Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311802Sphk * SUCH DAMAGE. 321802Sphk * 33115872Smarkm * @(#)mman.h 8.1 (Berkeley) 6/2/93 3419099Sphk * $Id$ 3519099Sphk */ 361802Sphk 371802Sphk/* 381802Sphk * Protections are chosen from these bits, or-ed together 391802Sphk */ 401802Sphk#define PROT_READ 0x01 /* pages can be read */ 411802Sphk#define PROT_WRITE 0x02 /* pages can be written */ 421802Sphk#define PROT_EXEC 0x04 /* pages can be executed */ 431802Sphk 441802Sphk/* 451802Sphk * Flags contain sharing type and options. 461802Sphk * Sharing types; choose one. 471802Sphk */ 481802Sphk#define MAP_SHARED 0x0001 /* share changes */ 491802Sphk#define MAP_PRIVATE 0x0002 /* changes are private */ 501802Sphk#define MAP_COPY 0x0004 /* "copy" region at mmap time */ 511802Sphk 521802Sphk/* 531802Sphk * Other flags 544245Sphk */ 551802Sphk#define MAP_FIXED 0x0010 /* map addr must be exactly as requested */ 561802Sphk#define MAP_RENAME 0x0020 /* Sun: rename private pages to file */ 571802Sphk#define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */ 584245Sphk#define MAP_INHERIT 0x0080 /* region is retained after exec */ 591802Sphk#define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */ 601802Sphk#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ 611802Sphk 621802Sphk/* 631802Sphk * Mapping type; default is map from file. 641802Sphk */ 651802Sphk#define MAP_ANON 0x1000 /* allocated from memory, swap space */ 661802Sphk 671802Sphk/* 681802Sphk * Advice to madvise 691802Sphk */ 701802Sphk#define MADV_NORMAL 0 /* no further special treatment */ 711802Sphk#define MADV_RANDOM 1 /* expect random page references */ 721802Sphk#define MADV_SEQUENTIAL 2 /* expect sequential page references */ 731802Sphk#define MADV_WILLNEED 3 /* will need these pages */ 741802Sphk#define MADV_DONTNEED 4 /* dont need these pages */ 751802Sphk 761802Sphk#ifndef KERNEL 771802Sphk 781802Sphk#include <sys/cdefs.h> 791802Sphk 801802Sphk__BEGIN_DECLS 811802Sphk/* Some of these int's should probably be size_t's */ 821802Sphkcaddr_t mmap __P((caddr_t, size_t, int, int, int, off_t)); 831802Sphkint mprotect __P((caddr_t, size_t, int)); 841802Sphkint munmap __P((caddr_t, size_t)); 851802Sphkint msync __P((caddr_t, size_t)); 861802Sphkint mlock __P((caddr_t, size_t)); 871802Sphkint munlock __P((caddr_t, size_t)); 881802Sphk__END_DECLS 891802Sphk 901802Sphk#endif /* !KERNEL */ 911802Sphk