summaryrefslogtreecommitdiff
path: root/PACE/pace/sys/mman.h
blob: 955cb8df851d805e018db3650a292cb82bbfa551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/sys/mman.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */

#ifndef PACE_SYS_MMAN_H
#define PACE_SYS_MMAN_H

#include "pace/config/defines.h"

#if (PACE_HAS_POSIX)
# include "pace/posix/mman.h"
#elif (PACE_VXWORKS)
# include "pace/vxworks/mman.h"
#elif (PACE_WIN32)
# include "pace/win32/mman.h"
#endif

#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */

  /**
     PACE's implementation of the POSIX function mlock.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.1.2.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_mlock (const void * addr, pace_size_t len);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function mlockall.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.1.1.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_mlockall (int flags);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function mmap.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.2.1.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE void * pace_mmap (void * addr,
                                pace_size_t len,
                                int prot,
                                int flags,
                                PACE_HANDLE fildes,
                                pace_off_t off);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function mprotect.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.2.3.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_mprotect (void * addr,
                                 pace_size_t len,
                                 int prot);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function msync.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.2.4.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_msync (void * addr,
                              pace_size_t len,
                              int flags);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function munlock.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.1.2.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_munlock (const void * addr, pace_size_t len);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function munlockall.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.1.1.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_munlockall ();
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function munmap.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.2.2.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_munmap (void * addr, pace_size_t len);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function shm_open.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.3.1.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE PACE_HANDLE pace_shm_open (const char * name,
                                         int oflag,
                                         pace_mode_t mode);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */
  /* Requires PACE_POSIX_C_SOURCE > 2. */

  /**
     PACE's implementation of the POSIX function shm_open.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 12.3.2.
     */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_shm_unlink (const char * name);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */
  /* Requires PACE_POSIX_C_SOURCE > 2. */

#if defined (PACE_HAS_INLINE)
#  if (PACE_HAS_POSIX)
#    include "pace/posix/mman.inl"
#  elif (PACE_VXWORKS)
#    include "pace/vxworks/mman.inl"
#  elif (PACE_WIN32)
#    include "pace/win32/mman.inl"
#  endif
#endif /* PACE_HAS_INLINE */

#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */

#endif /* PACE_SYS_MMAN_H */