comparison druntime/import/core/sys/posix/sys/shm.d @ 1458:e0b2d67cfe7c

Added druntime (this should be removed once it works).
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 02 Jun 2009 17:43:06 +0100
parents
children
comparison
equal deleted inserted replaced
1456:7b218ec1044f 1458:e0b2d67cfe7c
1 /**
2 * D header file for POSIX.
3 *
4 * Copyright: Copyright Sean Kelly 2005 - 2009.
5 * License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>.
6 * Authors: Sean Kelly
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8 *
9 * Copyright Sean Kelly 2005 - 2009.
10 * Distributed under the Boost Software License, Version 1.0.
11 * (See accompanying file LICENSE_1_0.txt or copy at
12 * http://www.boost.org/LICENSE_1_0.txt)
13 */
14 module core.sys.posix.sys.shm;
15
16 private import core.sys.posix.config;
17 public import core.sys.posix.sys.types; // for pid_t, time_t, key_t, size_t
18 public import core.sys.posix.sys.ipc;
19
20 extern (C):
21
22 //
23 // XOpen (XSI)
24 //
25 /*
26 SHM_RDONLY
27 SHM_RND
28
29 SHMLBA
30
31 shmatt_t
32
33 struct shmid_ds
34 {
35 ipc_perm shm_perm;
36 size_t shm_segsz;
37 pid_t shm_lpid;
38 pid_t shm_cpid;
39 shmatt_t shm_nattch;
40 time_t shm_atime;
41 time_t shm_dtime;
42 time_t shm_ctime;
43 }
44
45 void* shmat(int, in void*, int);
46 int shmctl(int, int, shmid_ds*);
47 int shmdt(in void*);
48 int shmget(key_t, size_t, int);
49 */
50
51 version( linux )
52 {
53 enum SHM_RDONLY = 010000;
54 enum SHM_RND = 020000;
55
56 int __getpagesize();
57 alias __getpagesize SHMLBA;
58
59 alias c_ulong shmatt_t;
60
61 struct shmid_ds
62 {
63 ipc_perm shm_perm;
64 size_t shm_segsz;
65 time_t shm_atime;
66 c_ulong __unused1;
67 time_t shm_dtime;
68 c_ulong __unused2;
69 time_t shm_ctime;
70 c_ulong __unused3;
71 pid_t shm_cpid;
72 pid_t shm_lpid;
73 shmatt_t shm_nattch;
74 c_ulong __unused4;
75 c_ulong __unused5;
76 }
77
78 void* shmat(int, in void*, int);
79 int shmctl(int, int, shmid_ds*);
80 int shmdt(in void*);
81 int shmget(key_t, size_t, int);
82 }
83 else version( freebsd )
84 {
85 enum SHM_RDONLY = 010000;
86 enum SHM_RND = 020000;
87 enum SHMLBA = 1 << 12; // PAGE_SIZE = (1<<PAGE_SHIFT)
88
89 alias c_ulong shmatt_t;
90
91 struct shmid_ds
92 {
93 ipc_perm shm_perm;
94 size_t shm_segsz;
95 time_t shm_atime;
96 c_ulong __unused1;
97 time_t shm_dtime;
98 c_ulong __unused2;
99 time_t shm_ctime;
100 c_ulong __unused3;
101 pid_t shm_cpid;
102 pid_t shm_lpid;
103 shmatt_t shm_nattch;
104 c_ulong __unused4;
105 c_ulong __unused5;
106 }
107
108 void* shmat(int, in void*, int);
109 int shmctl(int, int, shmid_ds*);
110 int shmdt(in void*);
111 int shmget(key_t, size_t, int);
112 }
113 else version( OSX )
114 {
115
116 }