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

Commit 7a6cc00

Browse files
committed
core.sys.posix.spawn: Add FreeBSD bindings
1 parent 048ab02 commit 7a6cc00

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/core/sys/posix/spawn.d

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Darwin XNU:
2424
https://opensource.apple.com/source/xnu/xnu-4570.71.2/libsyscall/wrappers/spawn/spawn.h.auto.html
2525
https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/sys/spawn.h.auto.html
2626
https://github.com/opensource-apple/xnu (GitHub mirror)
27+
28+
FreeBSD: https://github.com/freebsd/freebsd/blob/master/include/spawn.h
2729
*/
2830

2931
version (OSX) // macOS and iOS only as this API is prohibited on WatchOS and TVOS
@@ -233,5 +235,20 @@ else version (Darwin)
233235
alias posix_spawnattr_t = void*;
234236
alias posix_spawn_file_actions_t = void*;
235237
}
238+
else version (FreeBSD)
239+
{
240+
// Source: https://github.com/freebsd/freebsd/blob/master/include/spawn.h
241+
enum
242+
{
243+
POSIX_SPAWN_RESETIDS = 0x01,
244+
POSIX_SPAWN_SETPGROUP = 0x02,
245+
POSIX_SPAWN_SETSCHEDPARAM = 0x04,
246+
POSIX_SPAWN_SETSCHEDULER = 0x08,
247+
POSIX_SPAWN_SETSIGDEF = 0x10,
248+
POSIX_SPAWN_SETSIGMASK = 0x20
249+
}
250+
alias posix_spawnattr_t = void*;
251+
alias posix_spawn_file_actions_t = void*;
252+
}
236253
else
237254
static assert(0, "Unsupported OS");

0 commit comments

Comments
 (0)