+ short flags= 0;
+
+ // Child should not block signals
+ flags |= POSIX_SPAWN_SETSIGMASK;
+
+ sigset_t mask;
+ sigemptyset(&mask);
+
+ fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+
+#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
+ // Use USEVFORK on linux
+ flags |= POSIX_SPAWN_USEVFORK;
+#endif
+
+ flags |= POSIX_SPAWN_SETPGROUP;
+ fatal_assert(posix_spawnattr_setpgroup(&spawnattr, 0) == 0);
+
+ fatal_assert(posix_spawnattr_setflags(&spawnattr, flags) == 0);