mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
LibC: Add POSIX_SPAWN_SETSIGMASK
This isn't in posix yet, but it is implemented on some platforms and it will be in a future version: https://www.austingroupbugs.net/view.php?id=1044 It seems useful, so add it.
This commit is contained in:
parent
39d1a43c45
commit
2ddca326be
2 changed files with 11 additions and 1 deletions
|
@ -95,6 +95,12 @@ extern "C" {
|
|||
exit(127);
|
||||
}
|
||||
}
|
||||
if (flags & POSIX_SPAWN_SETSID) {
|
||||
if (setsid() < 0) {
|
||||
perror("posix_spawn setsid");
|
||||
exit(127);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: POSIX_SPAWN_SETSCHEDULER
|
||||
}
|
||||
|
@ -232,7 +238,7 @@ int posix_spawnattr_init(posix_spawnattr_t* attr)
|
|||
|
||||
int posix_spawnattr_setflags(posix_spawnattr_t* attr, short flags)
|
||||
{
|
||||
if (flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK))
|
||||
if (flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSID))
|
||||
return EINVAL;
|
||||
|
||||
attr->flags = flags;
|
||||
|
|
|
@ -50,8 +50,12 @@ enum {
|
|||
|
||||
POSIX_SPAWN_SETSIGDEF = 1 << 4,
|
||||
POSIX_SPAWN_SETSIGMASK = 1 << 5,
|
||||
|
||||
POSIX_SPAWN_SETSID = 1 << 6,
|
||||
};
|
||||
|
||||
#define POSIX_SPAWN_SETSID POSIX_SPAWN_SETSID
|
||||
|
||||
struct posix_spawn_file_actions_state;
|
||||
typedef struct {
|
||||
struct posix_spawn_file_actions_state* state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue