From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/process/posix_spawnattr_setflags.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/process/posix_spawnattr_setflags.c (limited to 'src/process/posix_spawnattr_setflags.c') 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 +#include + +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; +} -- cgit v1.2.3