1 #include <spawn.h> 2 #include <errno.h> 3 posix_spawnattr_setflags(posix_spawnattr_t * attr,short flags)4int posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags) 5 { 6 const unsigned all_flags = 7 POSIX_SPAWN_RESETIDS | 8 POSIX_SPAWN_SETPGROUP | 9 POSIX_SPAWN_SETSIGDEF | 10 POSIX_SPAWN_SETSIGMASK | 11 POSIX_SPAWN_SETSCHEDPARAM | 12 POSIX_SPAWN_SETSCHEDULER | 13 POSIX_SPAWN_USEVFORK | 14 POSIX_SPAWN_SETSID; 15 if (flags & ~all_flags) return EINVAL; 16 attr->__flags = flags; 17 return 0; 18 } 19