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