From 36aa6ca39cb96627db6882dfaa9044f7b0c9ff02 Mon Sep 17 00:00:00 2001 From: Harvey Hunt Date: Wed, 26 Oct 2022 21:22:31 +0100 Subject: [PATCH] linux: Add POSIX_SPAWN_SETSID flag This flag allows the child process created by POSIX spawn to create a new session and become leader of a new process group. Expose the flag so that Rust code can use it. --- libc-test/semver/linux.txt | 1 + src/unix/linux_like/linux/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index d8fa593c67795..14d3fe74b7cb1 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -1696,6 +1696,7 @@ POSIX_SPAWN_SETSCHEDULER POSIX_SPAWN_SETSIGDEF POSIX_SPAWN_SETSIGMASK POSIX_SPAWN_USEVFORK +POSIX_SPAWN_SETSID PROT_GROWSDOWN PROT_GROWSUP PR_CAPBSET_DROP diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 15174bc306419..273e70fb93af5 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1593,6 +1593,7 @@ pub const POSIX_MADV_RANDOM: ::c_int = 1; pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; pub const POSIX_MADV_WILLNEED: ::c_int = 3; pub const POSIX_SPAWN_USEVFORK: ::c_int = 64; +pub const POSIX_SPAWN_SETSID: ::c_int = 128; pub const S_IEXEC: mode_t = 64; pub const S_IWRITE: mode_t = 128;