epoc32/include/stdapis/sys/mman.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*-
     2  * Copyright (c) 1982, 1986, 1993
     3  *	The Regents of the University of California.  All rights reserved.
     4  *
     5  * Redistribution and use in source and binary forms, with or without
     6  * modification, are permitted provided that the following conditions
     7  * are met:
     8  * 1. Redistributions of source code must retain the above copyright
     9  *    notice, this list of conditions and the following disclaimer.
    10  * 2. Redistributions in binary form must reproduce the above copyright
    11  *    notice, this list of conditions and the following disclaimer in the
    12  *    documentation and/or other materials provided with the distribution.
    13  * 4. Neither the name of the University nor the names of its contributors
    14  *    may be used to endorse or promote products derived from this software
    15  *    without specific prior written permission.
    16  *
    17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    27  * SUCH DAMAGE.
    28  *  Portions Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
    29  *	@(#)mman.h	8.2 (Berkeley) 1/9/95
    30  * $FreeBSD: src/sys/sys/mman.h,v 1.40 2005/04/02 12:33:31 das Exp $
    31  */
    32 
    33 #ifndef _SYS_MMAN_H_
    34 #define _SYS_MMAN_H_
    35 #ifdef __cplusplus
    36  extern "C" 
    37  { 
    38   #endif
    39 
    40 #include <sys/cdefs.h>
    41 #include <sys/_types.h>
    42 
    43 #if __BSD_VISIBLE
    44 /*
    45  * Inheritance for minherit()
    46  */
    47 #define INHERIT_SHARE	0
    48 #define INHERIT_COPY	1
    49 #define INHERIT_NONE	2
    50 #endif
    51 
    52 /*
    53  * Protections are chosen from these bits, or-ed together
    54  */
    55 #define	PROT_NONE	0x00	/* no permissions */
    56 #define	PROT_READ	0x01	/* pages can be read */
    57 #define	PROT_WRITE	0x02	/* pages can be written */
    58 #define	PROT_EXEC	0x04	/* pages can be executed */
    59 
    60 /*
    61  * Flags contain sharing type and options.
    62  * Sharing types; choose one.
    63  */
    64 #define	MAP_SHARED	0x0001		/* share changes */
    65 #define	MAP_PRIVATE	0x0002		/* changes are private */
    66 #if __BSD_VISIBLE
    67 #define	MAP_COPY	MAP_PRIVATE	/* Obsolete */
    68 #endif
    69 
    70 /*
    71  * Other flags
    72  */
    73 #define	MAP_FIXED	 0x0010	/* map addr must be exactly as requested */
    74 
    75 /*
    76  * Error return from mmap()
    77  */
    78 #define MAP_FAILED	((void *)-1)
    79 
    80 /*
    81  * msync() flags
    82  */
    83 #define	MS_SYNC		0x0000	/* msync synchronously */
    84 #define MS_ASYNC	0x0001	/* return immediately */
    85 #define MS_INVALIDATE	0x0002	/* invalidate all cached data */
    86 
    87 #ifndef _MODE_T_DECLARED
    88 typedef	__mode_t	mode_t;
    89 #define	_MODE_T_DECLARED
    90 #endif
    91 
    92 #ifndef _OFF_T_DECLARED
    93 typedef	__off_t		off_t;
    94 #define	_OFF_T_DECLARED
    95 #endif
    96 
    97 #ifndef _SIZE_T_DECLARED
    98 typedef	__size_t	size_t;
    99 #define	_SIZE_T_DECLARED
   100 #endif
   101 
   102 #ifndef _KERNEL
   103 
   104 __BEGIN_DECLS
   105 /*
   106  * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
   107  * posix_typed_mem_open().
   108  */
   109 #ifndef _MMAP_DECLARED
   110 #define	_MMAP_DECLARED
   111 IMPORT_C void *	mmap(void *, size_t, int, int, int, off_t);
   112 
   113 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
   114 #define mmap64	mmap
   115 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
   116 
   117 #endif
   118 IMPORT_C int	mprotect(const void *, size_t, int);
   119 IMPORT_C int	msync(void *, size_t, int);
   120 IMPORT_C int	munmap(void *, size_t);
   121 #if __POSIX_VISIBLE >= 199309
   122 IMPORT_C int	shm_open(const char *, int, mode_t);
   123 IMPORT_C int	shm_unlink(const char *);
   124 #endif
   125 __END_DECLS
   126 
   127 #endif /* !_KERNEL */
   128 
   129 #ifdef __cplusplus
   130 }
   131 #endif	//__cplusplus
   132 
   133 #endif /* !_SYS_MMAN_H_ */