mirror of
git://git.musl-libc.org/musl
synced 2024-12-13 18:25:52 +00:00
implement new posix_spawn flag POSIX_SPAWN_SETSID
this functionality has been adopted for inclusion in the next issue of POSIX as the result of Austin Group issue #1044. based on patch by Daurnimator.
This commit is contained in:
parent
58e2396a9a
commit
bb439bb171
@ -21,6 +21,7 @@ struct sched_param;
|
|||||||
#define POSIX_SPAWN_SETSIGMASK 8
|
#define POSIX_SPAWN_SETSIGMASK 8
|
||||||
#define POSIX_SPAWN_SETSCHEDPARAM 16
|
#define POSIX_SPAWN_SETSCHEDPARAM 16
|
||||||
#define POSIX_SPAWN_SETSCHEDULER 32
|
#define POSIX_SPAWN_SETSCHEDULER 32
|
||||||
|
#define POSIX_SPAWN_SETSID 128
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int __flags;
|
int __flags;
|
||||||
|
@ -73,6 +73,10 @@ static int child(void *args_vp)
|
|||||||
__libc_sigaction(i, &sa, 0);
|
__libc_sigaction(i, &sa, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attr->__flags & POSIX_SPAWN_SETSID)
|
||||||
|
if ((ret=__syscall(SYS_setsid)) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
if (attr->__flags & POSIX_SPAWN_SETPGROUP)
|
if (attr->__flags & POSIX_SPAWN_SETPGROUP)
|
||||||
if ((ret=__syscall(SYS_setpgid, 0, attr->__pgrp)))
|
if ((ret=__syscall(SYS_setpgid, 0, attr->__pgrp)))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user