This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3][BZ 21340] add support for POSIX_SPAWN_SETSID
On 04/21/2017 04:13 PM, Adhemerval Zanella wrote:
* conform/data/spawn.h-data: Add POSIX_SPAWN_SETSID flag.
I think this has to go away ...
diff --git a/posix/spawn.h b/posix/spawn.h
index 36e3867..8d2ace1 100644
--- a/posix/spawn.h
+++ b/posix/spawn.h
@@ -60,6 +60,7 @@ typedef struct
#ifdef __USE_GNU
# define POSIX_SPAWN_USEVFORK 0x40
#endif
+#define POSIX_SPAWN_SETSID 0x80
... because this has to be governed by __GNU_SOURCE.
+static int
+do_test (void)
+{
+ pid_t sid, child_sid;
+ int res;
+
+ /* Current session ID. */
+ sid = getsid(0);
+ if (sid == (pid_t) -1)
+ FAIL_EXIT1 ("getsid (0): %m");
+
+ posix_spawnattr_t attrp;
+ posix_spawnattr_init (&attrp);
+ if (posix_spawnattr_setflags (&attrp, POSIX_SPAWN_SETSID))
+ FAIL_EXIT1 ("posix_spawnattr_setflags: %m");
Please run the test twice, once with setting POSIX_SPAWN_SETSID, and
once without.
Thanks,
Florian