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

Commit a118754

Browse files
committed
core.sys.posix.aio: Add musl bindings
https://git.musl-libc.org/cgit/musl/tree/include/aio.h
1 parent ebccd98 commit a118754

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
@@ -149,6 +170,15 @@ version (CRuntime_Glibc)
149170
AIO_ALLDONE
150171
}
151172
}
173+
else version (CRuntime_Musl)
174+
{
175+
enum
176+
{
177+
AIO_CANCELED,
178+
AIO_NOTCANCELED,
179+
AIO_ALLDONE
180+
}
181+
}
152182
else version (OSX)
153183
{
154184
enum
@@ -178,6 +208,15 @@ version (CRuntime_Glibc)
178208
LIO_NOP
179209
}
180210
}
211+
else version (CRuntime_Musl)
212+
{
213+
enum
214+
{
215+
LIO_READ,
216+
LIO_WRITE,
217+
LIO_NOP
218+
}
219+
}
181220
else version (OSX)
182221
{
183222
enum
@@ -206,6 +245,14 @@ version (CRuntime_Glibc)
206245
LIO_NOWAIT
207246
}
208247
}
248+
else version (CRuntime_Musl)
249+
{
250+
enum
251+
{
252+
LIO_WAIT,
253+
LIO_NOWAIT
254+
}
255+
}
209256
else version (OSX)
210257
{
211258
enum

0 commit comments

Comments
 (0)