home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / gcc / ixemulsdk.lha / include / sys / mman.h < prev    next >
C/C++ Source or Header  |  1996-12-11  |  4KB  |  95 lines

  1. /*    $NetBSD: mman.h,v 1.11 1995/03/26 20:24:23 jtc Exp $    */
  2.  
  3. /*-
  4.  * Copyright (c) 1982, 1986, 1993
  5.  *    The Regents of the University of California.  All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in the
  14.  *    documentation and/or other materials provided with the distribution.
  15.  * 3. All advertising materials mentioning features or use of this software
  16.  *    must display the following acknowledgement:
  17.  *    This product includes software developed by the University of
  18.  *    California, Berkeley and its contributors.
  19.  * 4. Neither the name of the University nor the names of its contributors
  20.  *    may be used to endorse or promote products derived from this software
  21.  *    without specific prior written permission.
  22.  *
  23.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  24.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  27.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  29.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  30.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  32.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33.  * SUCH DAMAGE.
  34.  *
  35.  *    @(#)mman.h    8.1 (Berkeley) 6/2/93
  36.  */
  37.  
  38. /*
  39.  * Protections are chosen from these bits, or-ed together
  40.  */
  41. #define    PROT_NONE    0x00    /* no permissions */
  42. #define    PROT_READ    0x01    /* pages can be read */
  43. #define    PROT_WRITE    0x02    /* pages can be written */
  44. #define    PROT_EXEC    0x04    /* pages can be executed */
  45.  
  46. /*
  47.  * Flags contain sharing type and options.
  48.  * Sharing types; choose one.
  49.  */
  50. #define    MAP_SHARED    0x0001    /* share changes */
  51. #define    MAP_PRIVATE    0x0002    /* changes are private */
  52. #define    MAP_COPY    0x0004    /* "copy" region at mmap time */
  53.  
  54. /*
  55.  * Other flags
  56.  */
  57. #define    MAP_FIXED     0x0010    /* map addr must be exactly as requested */
  58. #define    MAP_RENAME     0x0020    /* Sun: rename private pages to file */
  59. #define    MAP_NORESERVE     0x0040    /* Sun: don't reserve needed swap area */
  60. #define    MAP_INHERIT     0x0080    /* region is retained after exec */
  61. #define    MAP_NOEXTEND     0x0100    /* for MAP_FILE, don't change file size */
  62. #define    MAP_HASSEMAPHORE 0x0200    /* region may contain semaphores */
  63.  
  64. /*
  65.  * Mapping type
  66.  */
  67. #define    MAP_FILE    0x0000    /* map from file (default) */
  68. #define    MAP_ANON    0x1000    /* allocated from memory, swap space */
  69.  
  70. /*
  71.  * Advice to madvise
  72.  */
  73. #define    MADV_NORMAL    0    /* no further special treatment */
  74. #define    MADV_RANDOM    1    /* expect random page references */
  75. #define    MADV_SEQUENTIAL    2    /* expect sequential page references */
  76. #define    MADV_WILLNEED    3    /* will need these pages */
  77. #define    MADV_DONTNEED    4    /* dont need these pages */
  78.  
  79. #ifndef _KERNEL
  80.  
  81. #include <sys/cdefs.h>
  82.  
  83. __BEGIN_DECLS
  84. /* Some of these int's should probably be size_t's */
  85. caddr_t    mmap __P((caddr_t, size_t, int, int, int, off_t));
  86. int    mprotect __P((caddr_t, size_t, int));
  87. int    munmap __P((caddr_t, size_t));
  88. int    msync __P((caddr_t, size_t));
  89. int    mlock __P((caddr_t, size_t));
  90. int    munlock __P((caddr_t, size_t));
  91. int    madvise __P((caddr_t, size_t, int));
  92. __END_DECLS
  93.  
  94. #endif /* !_KERNEL */
  95.