@@ -32,6 +32,8 @@ NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
32
32
OpenBSD: https://github.com/openbsd/src/blob/master/include/spawn.h
33
33
34
34
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
35
37
*/
36
38
37
39
version (OSX ) // macOS and iOS only as this API is prohibited on WatchOS and TVOS
@@ -320,5 +322,49 @@ else version (DragonFlyBSD)
320
322
struct __posix_spawnattr ;
321
323
struct __posix_spawn_file_actions ;
322
324
}
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
+ }
323
369
else
324
370
static assert (0 , " Unsupported OS" );
0 commit comments