diff --git a/headers/posix/spawn.h b/headers/posix/spawn.h index 4726b53a0e..c3a0b1412d 100644 --- a/headers/posix/spawn.h +++ b/headers/posix/spawn.h @@ -23,6 +23,7 @@ #endif /* 0 */ #define POSIX_SPAWN_SETSIGDEF 0x10 #define POSIX_SPAWN_SETSIGMASK 0x20 +#define POSIX_SPAWN_SETSID 0x40 typedef struct _posix_spawnattr *posix_spawnattr_t; diff --git a/src/system/libroot/posix/spawn.cpp b/src/system/libroot/posix/spawn.cpp index 5bbd454f50..473a3b067d 100644 --- a/src/system/libroot/posix/spawn.cpp +++ b/src/system/libroot/posix/spawn.cpp @@ -361,6 +361,11 @@ process_spawnattr(const posix_spawnattr_t *_attr) return errno; } + if ((attr->flags & POSIX_SPAWN_SETSID) != 0) { + if (setsid() != 0) + return errno; + } + if ((attr->flags & POSIX_SPAWN_SETPGROUP) != 0) { if (setpgid(0, attr->pgroup) != 0) return errno;