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

Commit 7e2e7ab

Browse files
authored
Merge pull request #2343 from n8sh/aiomusl
core.sys.posix.aio: Add musl bindings merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 6f27f55 + a118754 commit 7e2e7ab

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

src/core/sys/posix/aio.d

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,27 @@ version (CRuntime_Glibc)
6363
}
6464
}
6565
}
66+
else version (CRuntime_Musl)
67+
{
68+
// https://git.musl-libc.org/cgit/musl/tree/include/aio.h
69+
struct aiocb
70+
{
71+
int aio_fildes;
72+
int aio_lio_opcode;
73+
int aio_reqprio;
74+
void* aio_buf; //volatile
75+
size_t aio_nbytes;
76+
sigevent aio_sigevent;
77+
void* __td;
78+
int[2] __lock;
79+
int __err; //volatile
80+
ssize_t __ret;
81+
off_t aio_offset;
82+
void* __next;
83+
void* __prev;
84+
ubyte[32-2*(void*).sizeof] __dummy4;
85+
}
86+
}
6687
else version (OSX)
6788
{
6889
struct aiocb
@@ -171,6 +192,15 @@ version (CRuntime_Glibc)
171192
AIO_ALLDONE
172193
}
173194
}
195+
else version (CRuntime_Musl)
196+
{
197+
enum
198+
{
199+
AIO_CANCELED,
200+
AIO_NOTCANCELED,
201+
AIO_ALLDONE
202+
}
203+
}
174204
else version (OSX)
175205
{
176206
enum
@@ -209,6 +239,15 @@ version (CRuntime_Glibc)
209239
LIO_NOP
210240
}
211241
}
242+
else version (CRuntime_Musl)
243+
{
244+
enum
245+
{
246+
LIO_READ,
247+
LIO_WRITE,
248+
LIO_NOP
249+
}
250+
}
212251
else version (OSX)
213252
{
214253
enum
@@ -246,6 +285,14 @@ version (CRuntime_Glibc)
246285
LIO_NOWAIT
247286
}
248287
}
288+
else version (CRuntime_Musl)
289+
{
290+
enum
291+
{
292+
LIO_WAIT,
293+
LIO_NOWAIT
294+
}
295+
}
249296
else version (OSX)
250297
{
251298
enum

0 commit comments

Comments
 (0)