mman.h

Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1982, 1986, 1993
00003  *      The Regents of the University of California.  All rights reserved.
00004  * © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 4. Neither the name of the University nor the names of its contributors
00015  *    may be used to endorse or promote products derived from this software
00016  *    without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00019  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00022  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00024  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00025  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00026  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00027  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00028  * SUCH DAMAGE.
00029  * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
00030  *      @(#)mman.h      8.2 (Berkeley) 1/9/95
00031  * $FreeBSD: src/sys/sys/mman.h,v 1.40 2005/04/02 12:33:31 das Exp $
00032  */
00033 
00034 #ifndef _SYS_MMAN_H_
00035 #define _SYS_MMAN_H_
00036 #ifdef __cplusplus
00037  extern "C" 
00038  { 
00039   #endif
00040 
00041 #include <sys/cdefs.h>
00042 #include <sys/_types.h>
00043 
00044 #if __BSD_VISIBLE
00045 /*
00046  * Inheritance for minherit()
00047  */
00048 #define INHERIT_SHARE   0
00049 #define INHERIT_COPY    1
00050 #define INHERIT_NONE    2
00051 #endif
00052 
00053 /*
00054  * Protections are chosen from these bits, or-ed together
00055  */
00056 #define PROT_NONE       0x00    /* no permissions */
00057 #define PROT_READ       0x01    /* pages can be read */
00058 #define PROT_WRITE      0x02    /* pages can be written */
00059 #define PROT_EXEC       0x04    /* pages can be executed */
00060 
00061 /*
00062  * Flags contain sharing type and options.
00063  * Sharing types; choose one.
00064  */
00065 #define MAP_SHARED      0x0001          /* share changes */
00066 #define MAP_PRIVATE     0x0002          /* changes are private */
00067 #if __BSD_VISIBLE
00068 #define MAP_COPY        MAP_PRIVATE     /* Obsolete */
00069 #endif
00070 
00071 /*
00072  * Other flags
00073  */
00074 #define MAP_FIXED        0x0010 /* map addr must be exactly as requested */
00075 /*
00076  * Error return from mmap()
00077  */
00078 #define MAP_FAILED      ((void *)-1)
00079 
00080 /*
00081  * msync() flags
00082  */
00083 #define MS_SYNC         0x0000  /* msync synchronously */
00084 #define MS_ASYNC        0x0001  /* return immediately */
00085 #define MS_INVALIDATE   0x0002  /* invalidate all cached data */
00086 
00087 #ifndef _MODE_T_DECLARED
00088 typedef __mode_t        mode_t;
00089 #define _MODE_T_DECLARED
00090 #endif
00091 
00092 #ifndef _OFF_T_DECLARED
00093 typedef __off_t         off_t;
00094 #define _OFF_T_DECLARED
00095 #endif
00096 
00097 #ifndef _SIZE_T_DECLARED
00098 typedef __size_t        size_t;
00099 #define _SIZE_T_DECLARED
00100 #endif
00101 
00102 #ifndef _KERNEL
00103 
00104 __BEGIN_DECLS
00105 /*
00106  * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
00107  * posix_typed_mem_open().
00108  */
00109 #ifndef _MMAP_DECLARED
00110 #define _MMAP_DECLARED
00111 IMPORT_C void * mmap(void *, size_t, int, int, int, off_t);
00112 #endif
00113 IMPORT_C int    mprotect(const void *, size_t, int);
00114 IMPORT_C int    msync(void *, size_t, int);
00115 IMPORT_C int    munmap(void *, size_t);
00116 __END_DECLS
00117 
00118 #endif /* !_KERNEL */
00119 
00120 #ifdef __cplusplus
00121 }
00122 //__cplusplus
00123 #endif
00124 
00125 #endif /* !_SYS_MMAN_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top