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