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

Commit 1e99127

Browse files
n8shPetarKirov
authored andcommitted
core.sys.posix.spawn: Add Solaris bindings
1 parent 292eae6 commit 1e99127

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/core/sys/posix/spawn.d

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
3232
OpenBSD: https://github.com/openbsd/src/blob/master/include/spawn.h
3333
3434
DragonFlyBSD: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/include/spawn.h
35+
36+
Solaris: https://github.com/illumos/illumos-gate/blob/master/usr/src/head/spawn.h
3537
*/
3638

3739
version (OSX) // macOS and iOS only as this API is prohibited on WatchOS and TVOS
@@ -320,5 +322,49 @@ else version (DragonFlyBSD)
320322
struct __posix_spawnattr;
321323
struct __posix_spawn_file_actions;
322324
}
325+
else version (Solaris)
326+
{
327+
// Source: https://github.com/illumos/illumos-gate/blob/master/usr/src/head/spawn.h
328+
enum
329+
{
330+
POSIX_SPAWN_RESETIDS = 0x01,
331+
POSIX_SPAWN_SETPGROUP = 0x02,
332+
POSIX_SPAWN_SETSIGDEF = 0x04,
333+
POSIX_SPAWN_SETSIGMASK = 0x08,
334+
POSIX_SPAWN_SETSCHEDPARAM = 0x10,
335+
POSIX_SPAWN_SETSCHEDULER = 0x20,
336+
}
337+
version (none)
338+
{
339+
// Non-portable Solaris extensions.
340+
enum
341+
{
342+
POSIX_SPAWN_SETSIGIGN_NP = 0x0800,
343+
POSIX_SPAWN_NOSIGCHLD_NP = 0x1000,
344+
POSIX_SPAWN_WAITPID_NP = 0x2000,
345+
POSIX_SPAWN_NOEXECERR_NP = 0x4000,
346+
}
347+
}
348+
struct posix_spawnattr_t
349+
{
350+
void* __spawn_attrp;
351+
}
352+
struct posix_spawn_file_actions_t
353+
{
354+
void* __file_attrp;
355+
}
356+
version (none)
357+
{
358+
// Non-portable Solaris extensions.
359+
alias boolean_t = int;
360+
int posix_spawn_file_actions_addclosefrom_np(posix_spawn_file_actions_t* file_actions,
361+
int lowfiledes);
362+
int posix_spawn_pipe_np(pid_t* pidp, int* fdp, const char* cmd, boolean_t write,
363+
posix_spawn_file_actions_t* fact,
364+
posix_spawnattr_t* attr);
365+
int posix_spawnattr_getsigignore_np(const posix_spawnattr_t* attr, sigset_t* sigignore);
366+
int posix_spawnattr_setsigignore_np(posix_spawnattr_t* attr, const sigset_t* sigignore);
367+
}
368+
}
323369
else
324370
static assert(0, "Unsupported OS");

0 commit comments

Comments
 (0)