xref: /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/core/sys/posix/sys/mman.d (revision 0a3071956a3a9fdebdbf7f338cf2d439b45fc728)
1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Copyright Sean Kelly 2005 - 2009.
5  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6  * Authors:   Sean Kelly, Alex Rønne Petersen
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 
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)
14  */
15 module core.sys.posix.sys.mman;
16 
17 import core.sys.posix.config;
18 public import core.sys.posix.sys.types; // for off_t, mode_t
19 
20 version (OSX)
21     version = Darwin;
22 else version (iOS)
23     version = Darwin;
24 else version (TVOS)
25     version = Darwin;
26 else version (WatchOS)
27     version = Darwin;
28 
29 version (ARM)     version = ARM_Any;
30 version (AArch64) version = ARM_Any;
31 version (HPPA)    version = HPPA_Any;
32 version (HPPA64)  version = HPPA_Any;
33 version (MIPS32)  version = MIPS_Any;
34 version (MIPS64)  version = MIPS_Any;
35 version (PPC)     version = PPC_Any;
36 version (PPC64)   version = PPC_Any;
37 version (RISCV32) version = RISCV_Any;
38 version (RISCV64) version = RISCV_Any;
39 version (S390)    version = IBMZ_Any;
40 version (SPARC)   version = SPARC_Any;
41 version (SPARC64) version = SPARC_Any;
42 version (SystemZ) version = IBMZ_Any;
43 version (X86)     version = X86_Any;
44 version (X86_64)  version = X86_Any;
45 
version(Posix)46 version (Posix):
47 extern (C) nothrow @nogc:
48 @system:
49 
50 //
51 // Advisory Information (ADV)
52 //
53 /*
54 int posix_madvise(void*, size_t, int);
55 */
56 
57 version (CRuntime_Glibc)
58 {
59     static if (_XOPEN_SOURCE >= 600)
60     {
61         int posix_madvise(void *__addr, size_t __len, int __advice);
62     }
63 }
version(Darwin)64 else version (Darwin)
65 {
66     int posix_madvise(void *addr, size_t len, int advice);
67 }
version(FreeBSD)68 else version (FreeBSD)
69 {
70     int posix_madvise(void *addr, size_t len, int advice);
71 }
version(NetBSD)72 else version (NetBSD)
73 {
74     int posix_madvise(void *addr, size_t len, int advice);
75 }
version(OpenBSD)76 else version (OpenBSD)
77 {
78     int posix_madvise(void *addr, size_t len, int advice);
79 }
version(DragonFlyBSD)80 else version (DragonFlyBSD)
81 {
82     int posix_madvise(void *addr, size_t len, int advice);
83 }
version(Solaris)84 else version (Solaris)
85 {
86 }
version(CRuntime_Bionic)87 else version (CRuntime_Bionic)
88 {
89 }
version(CRuntime_Musl)90 else version (CRuntime_Musl)
91 {
92     int posix_madvise(void *, size_t, int);
93 }
version(CRuntime_UClibc)94 else version (CRuntime_UClibc)
95 {
96     int posix_madvise(void *__addr, size_t __len, int __advice);
97 }
98 else
99 {
100     static assert(false, "Unsupported platform");
101 }
102 
103 
104 //
105 // Advisory Information and either Memory Mapped Files or Shared Memory Objects (MC1)
106 //
107 /*
108 POSIX_MADV_NORMAL
109 POSIX_MADV_SEQUENTIAL
110 POSIX_MADV_RANDOM
111 POSIX_MADV_WILLNEED
112 POSIX_MADV_DONTNEED
113 */
114 
version(linux)115 version (linux)
116 {
117     version (Alpha)
118         private enum __POSIX_MADV_DONTNEED = 6;
119     else
120         private enum __POSIX_MADV_DONTNEED = 4;
121 
122     enum
123     {
124         POSIX_MADV_NORMAL = 0,
125         POSIX_MADV_RANDOM = 1,
126         POSIX_MADV_SEQUENTIAL = 2,
127         POSIX_MADV_WILLNEED = 3,
128         POSIX_MADV_DONTNEED = __POSIX_MADV_DONTNEED,
129     }
130 }
131 else version (Darwin)
132 {
133     enum POSIX_MADV_NORMAL      = 0;
134     enum POSIX_MADV_RANDOM      = 1;
135     enum POSIX_MADV_SEQUENTIAL  = 2;
136     enum POSIX_MADV_WILLNEED    = 3;
137     enum POSIX_MADV_DONTNEED    = 4;
138 }
139 else version (FreeBSD)
140 {
141     enum POSIX_MADV_NORMAL      = 0;
142     enum POSIX_MADV_RANDOM      = 1;
143     enum POSIX_MADV_SEQUENTIAL  = 2;
144     enum POSIX_MADV_WILLNEED    = 3;
145     enum POSIX_MADV_DONTNEED    = 4;
146 }
147 else version (NetBSD)
148 {
149     enum POSIX_MADV_NORMAL      = 0;
150     enum POSIX_MADV_RANDOM      = 1;
151     enum POSIX_MADV_SEQUENTIAL  = 2;
152     enum POSIX_MADV_WILLNEED    = 3;
153     enum POSIX_MADV_DONTNEED    = 4;
154 }
155 else version (OpenBSD)
156 {
157     enum POSIX_MADV_NORMAL      = 0;
158     enum POSIX_MADV_RANDOM      = 1;
159     enum POSIX_MADV_SEQUENTIAL  = 2;
160     enum POSIX_MADV_WILLNEED    = 3;
161     enum POSIX_MADV_DONTNEED    = 4;
162 }
163 else version (DragonFlyBSD)
164 {
165     enum POSIX_MADV_NORMAL      = 0;
166     enum POSIX_MADV_RANDOM      = 1;
167     enum POSIX_MADV_SEQUENTIAL  = 2;
168     enum POSIX_MADV_WILLNEED    = 3;
169     enum POSIX_MADV_DONTNEED    = 4;
170 }
171 else version (Solaris)
172 {
173 }
174 else
175 {
176     static assert(false, "Unsupported platform");
177 }
178 
179 //
180 // Memory Mapped Files, Shared Memory Objects, or Memory Protection (MC2)
181 //
182 /*
183 PROT_READ
184 PROT_WRITE
185 PROT_EXEC
186 PROT_NONE
187 */
188 
189 version (linux)
190 {
191     enum PROT_NONE      = 0x0;
192     enum PROT_READ      = 0x1;
193     enum PROT_WRITE     = 0x2;
194     enum PROT_EXEC      = 0x4;
195 }
196 else version (Darwin)
197 {
198     enum PROT_NONE      = 0x00;
199     enum PROT_READ      = 0x01;
200     enum PROT_WRITE     = 0x02;
201     enum PROT_EXEC      = 0x04;
202 }
203 else version (FreeBSD)
204 {
205     enum PROT_NONE      = 0x00;
206     enum PROT_READ      = 0x01;
207     enum PROT_WRITE     = 0x02;
208     enum PROT_EXEC      = 0x04;
209 }
210 else version (NetBSD)
211 {
212     enum PROT_NONE      = 0x00;
213     enum PROT_READ      = 0x01;
214     enum PROT_WRITE     = 0x02;
215     enum PROT_EXEC      = 0x04;
216 }
217 else version (OpenBSD)
218 {
219     enum PROT_NONE      = 0x00;
220     enum PROT_READ      = 0x01;
221     enum PROT_WRITE     = 0x02;
222     enum PROT_EXEC      = 0x04;
223 }
224 else version (DragonFlyBSD)
225 {
226     enum PROT_NONE      = 0x00;
227     enum PROT_READ      = 0x01;
228     enum PROT_WRITE     = 0x02;
229     enum PROT_EXEC      = 0x04;
230 }
231 else version (Solaris)
232 {
233     enum PROT_NONE = 0x00;
234     enum PROT_READ = 0x01;
235     enum PROT_WRITE = 0x02;
236     enum PROT_EXEC = 0x04;
237 }
238 else
239 {
240     static assert(false, "Unsupported platform");
241 }
242 
243 //
244 // Memory Mapped Files, Shared Memory Objects, or Typed Memory Objects (MC3)
245 //
246 /*
247 void* mmap(void*, size_t, int, int, int, off_t);
248 int munmap(void*, size_t);
249 */
250 
251 version (CRuntime_Glibc)
252 {
253     static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
254     static if (__USE_FILE_OFFSET64)
255         alias mmap = mmap64;
256     else
257         void* mmap(void*, size_t, int, int, int, off_t);
258     int munmap(void*, size_t);
259 }
260 else version (Darwin)
261 {
262     void* mmap(void*, size_t, int, int, int, off_t);
263     int   munmap(void*, size_t);
264 }
265 else version (FreeBSD)
266 {
267     void* mmap(void*, size_t, int, int, int, off_t);
268     int   munmap(void*, size_t);
269 }
270 else version (NetBSD)
271 {
272     void* mmap(void*, size_t, int, int, int, off_t);
273     int   munmap(void*, size_t);
274 }
275 else version (OpenBSD)
276 {
277     void* mmap(void*, size_t, int, int, int, off_t);
278     int   munmap(void*, size_t);
279 }
280 else version (DragonFlyBSD)
281 {
282     void* mmap(void*, size_t, int, int, int, off_t);
283     int   munmap(void*, size_t);
284 }
285 else version (Solaris)
286 {
287     void* mmap(void*, size_t, int, int, int, off_t);
288     int   munmap(void*, size_t);
289 }
290 else version (CRuntime_Bionic)
291 {
292     void* mmap(void*, size_t, int, int, int, off_t);
293     int   munmap(void*, size_t);
294 }
295 else version (CRuntime_Musl)
296 {
297     static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
298     static if (__USE_FILE_OFFSET64)
299         alias mmap = mmap64;
300     else
301         void* mmap(void*, size_t, int, int, int, off_t);
302     int munmap(void*, size_t);
303 }
304 else version (CRuntime_UClibc)
305 {
306     static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
307     static if (__USE_FILE_OFFSET64)
308         alias mmap = mmap64;
309     else
310         void* mmap(void*, size_t, int, int, int, off_t);
311     int munmap(void*, size_t);
312 }
313 else
314 {
315     static assert(false, "Unsupported platform");
316 }
317 
318 //
319 // Memory Mapped Files (MF)
320 //
321 /*
322 MAP_SHARED (MF|SHM)
323 MAP_PRIVATE (MF|SHM)
324 MAP_FIXED  (MF|SHM)
325 MAP_FAILED (MF|SHM)
326 
327 MS_ASYNC (MF|SIO)
328 MS_SYNC (MF|SIO)
329 MS_INVALIDATE (MF|SIO)
330 */
331 
332 version (linux)
333 {
334     enum MAP_SHARED     = 0x01;
335     enum MAP_PRIVATE    = 0x02;
336     enum MAP_FIXED      = 0x10;
337 
338     enum MAP_FAILED     = cast(void*) -1;
339 
340     version (MICROBLAZE)
341         private enum DEFAULTS = true;
342     else version (Alpha)
343     {
344         private enum DEFAULTS = false;
345         enum MAP_ANON = 0x10;
346         enum MS_ASYNC = 1;
347         enum MS_SYNC = 2;
348         enum MS_INVALIDATE = 4;
349     }
350     else version (SH)
351         private enum DEFAULTS = true;
352     else version (ARM_Any)
353         private enum DEFAULTS = true;
354     else version (IBMZ_Any)
355         private enum DEFAULTS = true;
356     else version (IA64)
357         private enum DEFAULTS = true;
358     else version (HPPA_Any)
359     {
360         private enum DEFAULTS = false;
361         enum MAP_ANON = 0x10;
362         enum MS_SYNC = 1;
363         enum MS_ASYNC = 2;
364         enum MS_INVALIDATE = 4;
365     }
366     else version (M68K)
367         private enum DEFAULTS = true;
368     else version (TILE)
369         private enum DEFAULTS = true;
370     else version (X86_Any)
371         private enum DEFAULTS = true;
372     else version (MIPS_Any)
373     {
374         private enum DEFAULTS = false;
375         enum MAP_ANON = 0x0800;
376         enum MS_ASYNC = 1;
377         enum MS_INVALIDATE = 2;
378         enum MS_SYNC = 4;
379     }
380     else version (RISCV_Any)
381         private enum DEFAULTS = true;
382     else version (SPARC_Any)
383         private enum DEFAULTS = true;
384     else version (PPC_Any)
385         private enum DEFAULTS = true;
386     else
387         static assert(0, "unimplemented");
388 
389     static if (DEFAULTS)
390     {
391         enum MAP_ANON = 0x20;
392         enum MS_ASYNC = 1;
393         enum MS_INVALIDATE = 2;
394         enum MS_SYNC = 4;
395     }
396 }
397 else version (Darwin)
398 {
399     enum MAP_SHARED     = 0x0001;
400     enum MAP_PRIVATE    = 0x0002;
401     enum MAP_FIXED      = 0x0010;
402     enum MAP_ANON       = 0x1000;
403 
404     enum MAP_FAILED     = cast(void*)-1;
405 
406     enum MS_ASYNC       = 0x0001;
407     enum MS_INVALIDATE  = 0x0002;
408     enum MS_SYNC        = 0x0010;
409 }
410 else version (FreeBSD)
411 {
412     enum MAP_SHARED     = 0x0001;
413     enum MAP_PRIVATE    = 0x0002;
414     enum MAP_FIXED      = 0x0010;
415     enum MAP_ANON       = 0x1000;
416 
417     enum MAP_FAILED     = cast(void*)-1;
418 
419     enum MS_SYNC        = 0x0000;
420     enum MS_ASYNC       = 0x0001;
421     enum MS_INVALIDATE  = 0x0002;
422 }
423 else version (NetBSD)
424 {
425     enum MAP_SHARED     = 0x0001;
426     enum MAP_PRIVATE    = 0x0002;
427     enum MAP_FIXED      = 0x0010;
428     enum MAP_ANON       = 0x1000;
429 
430     enum MAP_FAILED     = cast(void*)-1;
431 
432     enum MS_SYNC        = 0x0004;
433     enum MS_ASYNC       = 0x0001;
434     enum MS_INVALIDATE  = 0x0002;
435 }
436 else version (OpenBSD)
437 {
438     enum MAP_SHARED     = 0x0001;
439     enum MAP_PRIVATE    = 0x0002;
440     enum MAP_FIXED      = 0x0010;
441     enum MAP_ANON       = 0x1000;
442     enum MAP_STACK      = 0x4000;
443 
444     enum MAP_FAILED     = cast(void*)-1;
445 
446     enum MS_SYNC        = 0x0002;
447     enum MS_ASYNC       = 0x0001;
448     enum MS_INVALIDATE  = 0x0004;
449 }
450 else version (DragonFlyBSD)
451 {
452     enum MAP_SHARED     = 0x0001;
453     enum MAP_PRIVATE    = 0x0002;
454     enum MAP_FIXED      = 0x0010;
455     enum MAP_ANON       = 0x1000;
456 
457     enum MAP_FAILED     = cast(void*)-1;
458 
459     enum MS_SYNC        = 0x0000;
460     enum MS_ASYNC       = 0x0001;
461     enum MS_INVALIDATE  = 0x0002;
462 }
463 else version (Solaris)
464 {
465     enum MAP_SHARED = 0x0001;
466     enum MAP_PRIVATE = 0x0002;
467     enum MAP_FIXED = 0x0010;
468     enum MAP_ANON = 0x0100;
469 
470     enum MAP_FAILED = cast(void*)-1;
471 
472     enum MS_SYNC = 0x0004;
473     enum MS_ASYNC = 0x0001;
474     enum MS_INVALIDATE  = 0x0002;
475 }
476 else
477 {
478     static assert(false, "Unsupported platform");
479 }
480 
481 /*
482 int msync(void*, size_t, int); (MF|SIO)
483 */
484 
485 version (CRuntime_Glibc)
486 {
487     int msync(void*, size_t, int);
488 }
489 else version (Darwin)
490 {
491     int msync(void*, size_t, int);
492 }
493 else version (FreeBSD)
494 {
495     int msync(void*, size_t, int);
496 }
497 else version (NetBSD)
498 {
499     int __msync13(void*, size_t, int);
500     alias msync = __msync13;
501 }
502 else version (OpenBSD)
503 {
504     int msync(void*, size_t, int);
505 }
506 else version (DragonFlyBSD)
507 {
508     int msync(void*, size_t, int);
509 }
510 else version (Solaris)
511 {
512     int msync(void*, size_t, int);
513 }
514 else version (CRuntime_Bionic)
515 {
516     int msync(const scope void*, size_t, int);
517 }
518 else version (CRuntime_Musl)
519 {
520     int msync(void*, size_t, int);
521 }
522 else version (CRuntime_UClibc)
523 {
524     int msync(void*, size_t, int);
525 }
526 else
527 {
528     static assert(false, "Unsupported platform");
529 }
530 
531 //
532 // Process Memory Locking (ML)
533 //
534 /*
535 MCL_CURRENT
536 MCL_FUTURE
537 */
538 
539 version (linux)
540 {
541     version (SPARC_Any) enum
542     {
543         MCL_CURRENT = 0x2000,
544         MCL_FUTURE = 0x4000,
545     }
546     else version (PPC_Any) enum
547     {
548         MCL_CURRENT = 0x2000,
549         MCL_FUTURE = 0x4000,
550     }
551     else version (Alpha) enum
552     {
553         MCL_CURRENT = 8192,
554         MCL_FUTURE = 16384,
555     }
556     else enum
557     {
558         MCL_CURRENT = 1,
559         MCL_FUTURE = 2,
560     }
561 }
562 else version (Darwin)
563 {
564     enum MCL_CURRENT    = 0x0001;
565     enum MCL_FUTURE     = 0x0002;
566 }
567 else version (FreeBSD)
568 {
569     enum MCL_CURRENT    = 0x0001;
570     enum MCL_FUTURE     = 0x0002;
571 }
572 else version (NetBSD)
573 {
574     enum MCL_CURRENT    = 0x0001;
575     enum MCL_FUTURE     = 0x0002;
576 }
577 else version (OpenBSD)
578 {
579     enum MCL_CURRENT    = 0x0001;
580     enum MCL_FUTURE     = 0x0002;
581 }
582 else version (DragonFlyBSD)
583 {
584     enum MCL_CURRENT    = 0x0001;
585     enum MCL_FUTURE     = 0x0002;
586 }
587 else version (Solaris)
588 {
589     enum MCL_CURRENT = 0x0001;
590     enum MCL_FUTURE = 0x0002;
591 }
592 else
593 {
594     static assert(false, "Unsupported platform");
595 }
596 
597 /*
598 int mlockall(int);
599 int munlockall();
600 */
601 
602 version (CRuntime_Glibc)
603 {
604     int mlockall(int);
605     int munlockall();
606 }
607 else version (Darwin)
608 {
609     int mlockall(int);
610     int munlockall();
611 }
612 else version (FreeBSD)
613 {
614     int mlockall(int);
615     int munlockall();
616 }
617 else version (NetBSD)
618 {
619     int mlockall(int);
620     int munlockall();
621 }
622 else version (OpenBSD)
623 {
624     int mlockall(int);
625     int munlockall();
626 }
627 else version (DragonFlyBSD)
628 {
629     int mlockall(int);
630     int munlockall();
631 }
632 else version (Solaris)
633 {
634     int mlockall(int);
635     int munlockall();
636 }
637 else version (CRuntime_Bionic)
638 {
639     int mlockall(int);
640     int munlockall();
641 }
642 else version (CRuntime_Musl)
643 {
644     int mlockall(int);
645     int munlockall();
646 }
647 else version (CRuntime_UClibc)
648 {
649     int mlockall(int);
650     int munlockall();
651 }
652 else
653 {
654     static assert(false, "Unsupported platform");
655 }
656 
657 //
658 // Range Memory Locking (MLR)
659 //
660 /*
661 int mlock(const scope void*, size_t);
662 int munlock(const scope void*, size_t);
663 */
664 
665 version (CRuntime_Glibc)
666 {
667     int mlock(const scope void*, size_t);
668     int munlock(const scope void*, size_t);
669 }
670 else version (Darwin)
671 {
672     int mlock(const scope void*, size_t);
673     int munlock(const scope void*, size_t);
674 }
675 else version (FreeBSD)
676 {
677     int mlock(const scope void*, size_t);
678     int munlock(const scope void*, size_t);
679 }
680 else version (NetBSD)
681 {
682     int mlock(const scope void*, size_t);
683     int munlock(const scope void*, size_t);
684 }
685 else version (OpenBSD)
686 {
687     int mlock(const scope void*, size_t);
688     int munlock(const scope void*, size_t);
689 }
690 else version (DragonFlyBSD)
691 {
692     int mlock(const scope void*, size_t);
693     int munlock(const scope void*, size_t);
694 }
695 else version (Solaris)
696 {
697     int mlock(const scope void*, size_t);
698     int munlock(const scope void*, size_t);
699 }
700 else version (CRuntime_Bionic)
701 {
702     int mlock(const scope void*, size_t);
703     int munlock(const scope void*, size_t);
704 }
705 else version (CRuntime_Musl)
706 {
707     int mlock(const scope void*, size_t);
708     int munlock(const scope void*, size_t);
709 }
710 else version (CRuntime_UClibc)
711 {
712     int mlock(const scope void*, size_t);
713     int munlock(const scope void*, size_t);
714 }
715 else
716 {
717     static assert(false, "Unsupported platform");
718 }
719 
720 //
721 // Memory Protection (MPR)
722 //
723 /*
724 int mprotect(void*, size_t, int);
725 */
726 
727 version (CRuntime_Glibc)
728 {
729     int mprotect(void*, size_t, int);
730 }
731 else version (Darwin)
732 {
733     int mprotect(void*, size_t, int);
734 }
735 else version (FreeBSD)
736 {
737     int mprotect(void*, size_t, int);
738 }
739 else version (NetBSD)
740 {
741     int mprotect(void*, size_t, int);
742 }
743 else version (OpenBSD)
744 {
745     int mprotect(void*, size_t, int);
746 }
747 else version (DragonFlyBSD)
748 {
749     int mprotect(void*, size_t, int);
750 }
751 else version (Solaris)
752 {
753     int mprotect(void*, size_t, int);
754 }
755 else version (CRuntime_Bionic)
756 {
757     int mprotect(const scope void*, size_t, int);
758 }
759 else version (CRuntime_Musl)
760 {
761     int mprotect(void*, size_t, int);
762 }
763 else version (CRuntime_UClibc)
764 {
765     int mprotect(void*, size_t, int);
766 }
767 else
768 {
769     static assert(false, "Unsupported platform");
770 }
771 
772 //
773 // Shared Memory Objects (SHM)
774 //
775 /*
776 int shm_open(const scope char*, int, mode_t);
777 int shm_unlink(const scope char*);
778 */
779 
780 version (CRuntime_Glibc)
781 {
782     int shm_open(const scope char*, int, mode_t);
783     int shm_unlink(const scope char*);
784 }
785 else version (Darwin)
786 {
787     int shm_open(const scope char*, int, mode_t);
788     int shm_unlink(const scope char*);
789 }
790 else version (FreeBSD)
791 {
792     int shm_open(const scope char*, int, mode_t);
793     int shm_unlink(const scope char*);
794 }
795 else version (NetBSD)
796 {
797     int shm_open(const scope char*, int, mode_t);
798     int shm_unlink(const scope char*);
799 }
800 else version (OpenBSD)
801 {
802     int shm_open(const scope char*, int, mode_t);
803     int shm_unlink(const scope char*);
804 }
805 else version (DragonFlyBSD)
806 {
807     int shm_open(const scope char*, int, mode_t);
808     int shm_unlink(const scope char*);
809 }
810 else version (Solaris)
811 {
812     int shm_open(const scope char*, int, mode_t);
813     int shm_unlink(const scope char*);
814 }
815 else version (CRuntime_Bionic)
816 {
817 }
818 else version (CRuntime_Musl)
819 {
820     int shm_open(const scope char*, int, mode_t);
821     int shm_unlink(const scope char*);
822 }
823 else version (CRuntime_UClibc)
824 {
825     int shm_open(const scope char*, int, mode_t);
826     int shm_unlink(const scope char*);
827 }
828 else
829 {
830     static assert(false, "Unsupported platform");
831 }
832 
833 //
834 // Typed Memory Objects (TYM)
835 //
836 /*
837 POSIX_TYPED_MEM_ALLOCATE
838 POSIX_TYPED_MEM_ALLOCATE_CONTIG
839 POSIX_TYPED_MEM_MAP_ALLOCATABLE
840 
841 struct posix_typed_mem_info
842 {
843     size_t posix_tmi_length;
844 }
845 
846 int posix_mem_offset(const scope void*, size_t, off_t *, size_t *, int *);
847 int posix_typed_mem_get_info(int, struct posix_typed_mem_info *);
848 int posix_typed_mem_open(const scope char*, int, int);
849 */
850