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

Commit 5f0626f

Browse files
committed
core.sys.posix.spawn: Add OpenBSD bindings
1 parent 4efb45e commit 5f0626f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/core/sys/posix/spawn.d

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ https://github.com/opensource-apple/xnu (GitHub mirror)
2828
FreeBSD: https://github.com/freebsd/freebsd/blob/master/include/spawn.h
2929
3030
NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
31+
32+
OpenBSD: https://github.com/openbsd/src/blob/master/include/spawn.h
3133
*/
3234

3335
version (OSX) // macOS and iOS only as this API is prohibited on WatchOS and TVOS
@@ -282,5 +284,22 @@ else version (NetBSD)
282284
posix_spawn_file_actions_entry_t* fae;
283285
}
284286
}
287+
else version (OpenBSD)
288+
{
289+
// Source: https://github.com/openbsd/src/blob/master/include/spawn.h
290+
enum
291+
{
292+
POSIX_SPAWN_RESETIDS = 0x01,
293+
POSIX_SPAWN_SETPGROUP = 0x02,
294+
POSIX_SPAWN_SETSCHEDPARAM = 0x04,
295+
POSIX_SPAWN_SETSCHEDULER = 0x08,
296+
POSIX_SPAWN_SETSIGDEF = 0x10,
297+
POSIX_SPAWN_SETSIGMASK = 0x20
298+
}
299+
alias posix_spawnattr_t = __posix_spawnattr*;
300+
alias posix_spawn_file_actions_t = __posix_spawn_file_actions*;
301+
struct __posix_spawnattr;
302+
struct __posix_spawn_file_actions;
303+
}
285304
else
286305
static assert(0, "Unsupported OS");

0 commit comments

Comments
 (0)