diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2024-10-01 15:47:05 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2024-10-01 15:47:05 +0200 |
commit | 4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch) | |
tree | ebf009bf1376a5a223a915bc27cbbd791a1316bc /src/process/posix_spawnattr_setflags.c |
Initial version
Diffstat (limited to 'src/process/posix_spawnattr_setflags.c')
-rw-r--r-- | src/process/posix_spawnattr_setflags.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/process/posix_spawnattr_setflags.c b/src/process/posix_spawnattr_setflags.c new file mode 100644 index 0000000..6878099 --- /dev/null +++ b/src/process/posix_spawnattr_setflags.c @@ -0,0 +1,18 @@ +#include <spawn.h> +#include <errno.h> + +int posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags) +{ + const unsigned all_flags = + POSIX_SPAWN_RESETIDS | + POSIX_SPAWN_SETPGROUP | + POSIX_SPAWN_SETSIGDEF | + POSIX_SPAWN_SETSIGMASK | + POSIX_SPAWN_SETSCHEDPARAM | + POSIX_SPAWN_SETSCHEDULER | + POSIX_SPAWN_USEVFORK | + POSIX_SPAWN_SETSID; + if (flags & ~all_flags) return EINVAL; + attr->__flags = flags; + return 0; +} |