@@ -26,6 +26,8 @@ https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/sys/spawn.h.auto.html
26
26
https://github.com/opensource-apple/xnu (GitHub mirror)
27
27
28
28
FreeBSD: https://github.com/freebsd/freebsd/blob/master/include/spawn.h
29
+
30
+ NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
29
31
*/
30
32
31
33
version (OSX ) // macOS and iOS only as this API is prohibited on WatchOS and TVOS
@@ -250,5 +252,35 @@ else version (FreeBSD)
250
252
alias posix_spawnattr_t = void * ;
251
253
alias posix_spawn_file_actions_t = void * ;
252
254
}
255
+ else version (NetBSD )
256
+ {
257
+ // Source: https://github.com/NetBSD/src/blob/trunk/sys/sys/spawn.h
258
+ enum
259
+ {
260
+ POSIX_SPAWN_RESETIDS = 0x01 ,
261
+ POSIX_SPAWN_SETPGROUP = 0x02 ,
262
+ POSIX_SPAWN_SETSCHEDPARAM = 0x04 ,
263
+ POSIX_SPAWN_SETSCHEDULER = 0x08 ,
264
+ POSIX_SPAWN_SETSIGDEF = 0x10 ,
265
+ POSIX_SPAWN_SETSIGMASK = 0x20 ,
266
+ POSIX_SPAWN_RETURNERROR = 0x40 // NetBSD specific
267
+ }
268
+ struct posix_spawnattr
269
+ {
270
+ short sa_flags;
271
+ pid_t sa_pgroup;
272
+ sched_param sa_schedparam;
273
+ int sa_schedpolicy;
274
+ sigset_t sa_sigdefault;
275
+ sigset_t sa_sigmask;
276
+ }
277
+ struct posix_spawn_file_actions_entry_t ;
278
+ struct posix_spawn_file_actions
279
+ {
280
+ uint size;
281
+ uint len;
282
+ posix_spawn_file_actions_entry_t* fae;
283
+ }
284
+ }
253
285
else
254
286
static assert (0 , " Unsupported OS" );
0 commit comments