mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
[BZ 21340] add support for POSIX_SPAWN_SETSID
This patch adds support for the POSIX_SPAWN_SETSID flag. It was recently accepted by the Austin Group: http://austingroupbugs.net/view.php?id=1044 Checked on x86_64 Daurnimator <quae@daurnimator.com> Adhemerval Zanella <adhemerval.zanella@linaro.org> [BZ #21340] * posix/Makefile (tests): Add tst-posix_spawn-setsid to list of tests. * posix/spawn.h: define POSIX_SPAWN_SETSID flag. * posix/spawnattr_setflags.c (ALL_FLAGS): Add POSIX_SPAWN_SETSID to valid flags. * posix/tst-posix_spawn-setsid.c: Add test for POSIX_SPAWN_SETSID. * sysdeps/mach/hurd/spawni.c (__spawni): Implementation of POSIX_SPAWN_SETSID. * sysdeps/posix/spawni.c (__spawni): Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise. * NEWS: Add note about POSIX_SPAWN_SETSID support.
This commit is contained in:
@ -177,6 +177,10 @@ __spawni_child (void *arguments)
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((attr->__flags & POSIX_SPAWN_SETSID) != 0
|
||||
&& __setsid () < 0)
|
||||
goto fail;
|
||||
|
||||
/* Set the process group ID. */
|
||||
if ((attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
|
||||
&& (ret = __setpgid (0, attr->__pgrp)) != 0)
|
||||
|
Reference in New Issue
Block a user