2 * D header file for POSIX.
4 * Copyright: Copyright Sean Kelly 2005 - 2009.
5 * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
10 /* Copyright Sean Kelly 2005 - 2009.
11 * Distributed under the Boost Software License, Version 1.0.
12 * (See accompanying file LICENSE or copy at
13 * http://www.boost.org/LICENSE_1_0.txt)
15 module core
.sys
.posix
.sys
.shm
;
17 import core
.sys
.posix
.config
;
18 public import core
.sys
.posix
.sys
.types
; // for pid_t, time_t, key_t
19 public import core
.sys
.posix
.sys
.ipc
;
27 else version (WatchOS
)
31 extern (C
) nothrow @nogc:
57 enum SHM_RDONLY
= 0x01000; // 010000
58 enum SHM_RND
= 0x02000; // 020000
59 enum SHM_REMAP
= 0x4000; // 040000
61 alias c_ulong shmatt_t
;
63 /* For any changes, please check /usr/include/bits/shm.h */
69 version (X86_64
) {} else c_ulong __unused1
;
71 version (X86_64
) {} else c_ulong __unused2
;
73 version (X86_64
) {} else c_ulong __unused3
;
81 else version (FreeBSD
)
83 enum SHM_RDONLY
= 0x01000; // 010000
84 enum SHM_RND
= 0x02000; // 020000
86 alias c_ulong shmatt_t
;
88 struct shmid_ds_old
// <= FreeBSD7
90 ipc_perm_old shm_perm
;
113 else version (NetBSD
)
115 enum SHM_RDONLY
= 0x01000; // 010000
116 enum SHM_RND
= 0x02000; // 020000
118 alias c_ulong shmatt_t
;
133 else version (OpenBSD
)
135 enum SHM_RDONLY
= 0x01000; // 010000
136 enum SHM_RND
= 0x02000; // 020000
138 alias short shmatt_t
;
148 c_long __shm_atimensec
;
150 c_long __shm_dtimensec
;
152 c_long __shm_ctimensec
;
156 else version (DragonFlyBSD
)
158 enum SHM_RDONLY
= 0x01000; // 010000
159 enum SHM_RND
= 0x02000; // 020000
161 alias c_ulong shmatt_t
;
173 private void* shm_internal
;
176 else version (Darwin
)
180 else version (Solaris
)
186 static assert(false, "Unsupported platform");
192 void* shmat(int, const scope void*, int);
193 int shmctl(int, int, shmid_ds*);
194 int shmdt(const scope void*);
195 int shmget(key_t, size_t, int);
198 version (CRuntime_Glibc
)
201 alias __getpagesize SHMLBA
;
203 void* shmat(int, const scope void*, int);
204 int shmctl(int, int, shmid_ds
*);
205 int shmdt(const scope void*);
206 int shmget(key_t
, size_t
, int);
208 else version (FreeBSD
)
210 enum SHMLBA
= 1 << 12; // PAGE_SIZE = (1<<PAGE_SHIFT)
212 void* shmat(int, const scope void*, int);
213 int shmctl(int, int, shmid_ds
*);
214 int shmdt(const scope void*);
215 int shmget(key_t
, size_t
, int);
217 else version (NetBSD
)
219 enum SHMLBA
= 1 << 12; // PAGE_SIZE = (1<<PAGE_SHIFT)
221 void* shmat(int, const scope void*, int);
222 int shmctl(int, int, shmid_ds
*);
223 int shmdt(const scope void*);
224 int shmget(key_t
, size_t
, int);
226 else version (OpenBSD
)
228 enum SHMLBA
= 1 << _MAX_PAGE_SHIFT
;
230 void* shmat(int, const scope void*, int);
231 int shmctl(int, int, shmid_ds
*);
232 int shmdt(const scope void*);
233 int shmget(key_t
, size_t
, int);
235 else version (DragonFlyBSD
)
237 enum SHMLBA
= 1 << 12; // PAGE_SIZE = (1<<PAGE_SHIFT)
239 void* shmat(int, const scope void*, int);
240 int shmctl(int, int, shmid_ds
*);
241 int shmdt(const scope void*);
242 int shmget(key_t
, size_t
, int);
244 else version (Darwin
)
248 else version (Solaris
)
252 else version (CRuntime_Musl
)
256 void* shmat(int, const scope void*, int);
257 int shmctl(int, int, shmid_ds
*);
258 int shmdt(const scope void*);
259 int shmget(key_t
, size_t
, int);
261 else version (CRuntime_Bionic
)
265 deprecated("Not useful on Android because it's disallowed by SELinux")
267 void* shmat(int, const scope void*, int);
268 int shmctl(int, int, shmid_ds
*);
269 int shmdt(const scope void*);
270 int shmget(key_t
, size_t
, int);
273 else version (CRuntime_UClibc
)
276 alias __getpagesize SHMLBA
;
278 void* shmat(int, const scope void*, int);
279 int shmctl(int, int, shmid_ds
*);
280 int shmdt(const scope void*);
281 int shmget(key_t
, size_t
, int);
285 static assert(false, "Unsupported platform");