posix_spawn: add POSIX_SPAWN_SETSID.
see http://austingroupbugs.net/view.php?id=1044 Change-Id: I9ae4fe07ea0fa7e20eb9a1d8c64e971e7353bcff Reviewed-on: https://review.haiku-os.org/c/1008 Reviewed-by: Rene Gollent <rene@gollent.com>
This commit is contained in:
parent
f0a99f2bea
commit
af61539918
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user