Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 6dd5d20

Browse files
authored
Merge pull request #2106 from dkgroot-dlang/fix_shm
[Trivial] Add dragonfly implementation for shared memory merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2 parents 89745f5 + be44503 commit 6dd5d20

File tree

1 file changed

+26
-0
lines changed
  • src/core/sys/posix/sys

1 file changed

+26
-0
lines changed

src/core/sys/posix/sys/shm.d

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,32 @@ else version(NetBSD)
156156
int shmdt(in void*);
157157
int shmget(key_t, size_t, int);
158158
}
159+
else version(DragonFlyBSD)
160+
{
161+
enum SHM_RDONLY = 0x01000; // 010000
162+
enum SHM_RND = 0x02000; // 020000
163+
enum SHMLBA = 1 << 12; // PAGE_SIZE = (1<<PAGE_SHIFT)
164+
165+
alias c_ulong shmatt_t;
166+
167+
struct shmid_ds
168+
{
169+
ipc_perm shm_perm;
170+
int shm_segsz;
171+
pid_t shm_lpid;
172+
pid_t shm_cpid;
173+
short shm_nattch;
174+
time_t shm_atime;
175+
time_t shm_dtime;
176+
time_t shm_ctime;
177+
private void* shm_internal;
178+
}
179+
180+
void* shmat(int, in void*, int);
181+
int shmctl(int, int, shmid_ds*);
182+
int shmdt(in void*);
183+
int shmget(key_t, size_t, int);
184+
}
159185
else version( Darwin )
160186
{
161187

0 commit comments

Comments
 (0)