1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/include/sys/mman.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,133 @@
1.4 +/*-
1.5 + * Copyright (c) 1982, 1986, 1993
1.6 + * The Regents of the University of California. All rights reserved.
1.7 + *
1.8 + * Redistribution and use in source and binary forms, with or without
1.9 + * modification, are permitted provided that the following conditions
1.10 + * are met:
1.11 + * 1. Redistributions of source code must retain the above copyright
1.12 + * notice, this list of conditions and the following disclaimer.
1.13 + * 2. Redistributions in binary form must reproduce the above copyright
1.14 + * notice, this list of conditions and the following disclaimer in the
1.15 + * documentation and/or other materials provided with the distribution.
1.16 + * 4. Neither the name of the University nor the names of its contributors
1.17 + * may be used to endorse or promote products derived from this software
1.18 + * without specific prior written permission.
1.19 + *
1.20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1.21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1.24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.30 + * SUCH DAMAGE.
1.31 + * Portions Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.32 + * @(#)mman.h 8.2 (Berkeley) 1/9/95
1.33 + * $FreeBSD: src/sys/sys/mman.h,v 1.40 2005/04/02 12:33:31 das Exp $
1.34 + */
1.35 +
1.36 +#ifndef _SYS_MMAN_H_
1.37 +#define _SYS_MMAN_H_
1.38 +#ifdef __cplusplus
1.39 + extern "C"
1.40 + {
1.41 + #endif
1.42 +
1.43 +#include <sys/cdefs.h>
1.44 +#include <sys/_types.h>
1.45 +
1.46 +#if __BSD_VISIBLE
1.47 +/*
1.48 + * Inheritance for minherit()
1.49 + */
1.50 +#define INHERIT_SHARE 0
1.51 +#define INHERIT_COPY 1
1.52 +#define INHERIT_NONE 2
1.53 +#endif
1.54 +
1.55 +/*
1.56 + * Protections are chosen from these bits, or-ed together
1.57 + */
1.58 +#define PROT_NONE 0x00 /* no permissions */
1.59 +#define PROT_READ 0x01 /* pages can be read */
1.60 +#define PROT_WRITE 0x02 /* pages can be written */
1.61 +#define PROT_EXEC 0x04 /* pages can be executed */
1.62 +
1.63 +/*
1.64 + * Flags contain sharing type and options.
1.65 + * Sharing types; choose one.
1.66 + */
1.67 +#define MAP_SHARED 0x0001 /* share changes */
1.68 +#define MAP_PRIVATE 0x0002 /* changes are private */
1.69 +#if __BSD_VISIBLE
1.70 +#define MAP_COPY MAP_PRIVATE /* Obsolete */
1.71 +#endif
1.72 +
1.73 +/*
1.74 + * Other flags
1.75 + */
1.76 +#define MAP_FIXED 0x0010 /* map addr must be exactly as requested */
1.77 +
1.78 +/*
1.79 + * Error return from mmap()
1.80 + */
1.81 +#define MAP_FAILED ((void *)-1)
1.82 +
1.83 +/*
1.84 + * msync() flags
1.85 + */
1.86 +#define MS_SYNC 0x0000 /* msync synchronously */
1.87 +#define MS_ASYNC 0x0001 /* return immediately */
1.88 +#define MS_INVALIDATE 0x0002 /* invalidate all cached data */
1.89 +
1.90 +#ifndef _MODE_T_DECLARED
1.91 +typedef __mode_t mode_t;
1.92 +#define _MODE_T_DECLARED
1.93 +#endif
1.94 +
1.95 +#ifndef _OFF_T_DECLARED
1.96 +typedef __off_t off_t;
1.97 +#define _OFF_T_DECLARED
1.98 +#endif
1.99 +
1.100 +#ifndef _SIZE_T_DECLARED
1.101 +typedef __size_t size_t;
1.102 +#define _SIZE_T_DECLARED
1.103 +#endif
1.104 +
1.105 +#ifndef _KERNEL
1.106 +
1.107 +__BEGIN_DECLS
1.108 +/*
1.109 + * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
1.110 + * posix_typed_mem_open().
1.111 + */
1.112 +#ifndef _MMAP_DECLARED
1.113 +#define _MMAP_DECLARED
1.114 +IMPORT_C void * mmap(void *, size_t, int, int, int, off_t);
1.115 +
1.116 +#if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
1.117 +#define mmap64 mmap
1.118 +#endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
1.119 +
1.120 +#endif
1.121 +IMPORT_C int mprotect(const void *, size_t, int);
1.122 +IMPORT_C int msync(void *, size_t, int);
1.123 +IMPORT_C int munmap(void *, size_t);
1.124 +#if __POSIX_VISIBLE >= 199309
1.125 +IMPORT_C int shm_open(const char *, int, mode_t);
1.126 +IMPORT_C int shm_unlink(const char *);
1.127 +#endif
1.128 +__END_DECLS
1.129 +
1.130 +#endif /* !_KERNEL */
1.131 +
1.132 +#ifdef __cplusplus
1.133 +}
1.134 +#endif //__cplusplus
1.135 +
1.136 +#endif /* !_SYS_MMAN_H_ */