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

Commit 048ab02

Browse files
committed
core.sys.posix.spawn: Add uClibc libc bindings
1 parent 62fe98e commit 048ab02

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/core/sys/posix/spawn.d

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Bionic libc: https://android.googlesource.com/platform/bionic.git/+/master/libc/
1818
1919
Musl libc: https://git.musl-libc.org/cgit/musl/tree/include/spawn.h
2020
21+
uClibc: https://git.uclibc.org/uClibc/tree/include/spawn.h
22+
2123
Darwin XNU:
2224
https://opensource.apple.com/source/xnu/xnu-4570.71.2/libsyscall/wrappers/spawn/spawn.h.auto.html
2325
https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/sys/spawn.h.auto.html
@@ -171,6 +173,44 @@ version (linux)
171173
int[16] __pad;
172174
}
173175
}
176+
else version (CRuntime_UClibc)
177+
{
178+
// Source: https://git.uclibc.org/uClibc/tree/include/spawn.h
179+
enum
180+
{
181+
POSIX_SPAWN_RESETIDS = 0x01,
182+
POSIX_SPAWN_SETPGROUP = 0x02,
183+
POSIX_SPAWN_SETSIGDEF = 0x04,
184+
POSIX_SPAWN_SETSIGMASK = 0x08,
185+
POSIX_SPAWN_SETSCHEDPARAM = 0x10,
186+
POSIX_SPAWN_SETSCHEDULER = 0x20
187+
}
188+
import core.sys.posix.config : __USE_GNU;
189+
static if (__USE_GNU)
190+
{
191+
enum
192+
{
193+
POSIX_SPAWN_USEVFORK = 0x40,
194+
}
195+
}
196+
struct posix_spawnattr_t
197+
{
198+
short __flags;
199+
pid_t __pgrp;
200+
sigset_t __sd;
201+
sigset_t __ss;
202+
sched_param __sp;
203+
int __policy;
204+
int[16] __pad;
205+
}
206+
struct posix_spawn_file_actions_t
207+
{
208+
int __allocated;
209+
int __used;
210+
__spawn_action* __actions;
211+
int[16] __pad;
212+
}
213+
}
174214
else
175215
static assert(0, "Unsupported Linux libc");
176216
}

0 commit comments

Comments
 (0)