[glib: 5/7] gspawn: document FD_CLOEXEC behaviour
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 5/7] gspawn: document FD_CLOEXEC behaviour
- Date: Thu, 21 Jun 2018 17:12:18 +0000 (UTC)
commit 86e2b8d427ff1ce7bf45cc032584116318f41c3f
Author: Daniel Drake <drake endlessm com>
Date: Wed Jun 13 13:41:53 2018 -0600
gspawn: document FD_CLOEXEC behaviour
G_SPAWN_LEAVE_DESCRIPTORS_OPEN must be set to enable the optimized
posix_spawn codepath, so this flag is likely to see more usage now.
Document that FD_CLOEXEC can be used to cause file descriptors to be
automatically closed while this flag is used.
glib/gspawn.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/glib/gspawn.c b/glib/gspawn.c
index 5db8a0741..37f7cd34b 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -638,10 +638,11 @@ g_spawn_sync (const gchar *working_directory,
* is equivalent to calling CloseHandle() on the process handle returned
* in @child_pid). See g_child_watch_add().
*
- * %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
- * descriptors will be inherited by the child; otherwise all descriptors
- * except stdin/stdout/stderr will be closed before calling exec() in
- * the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
+ * Open UNIX file descriptors marked as `FD_CLOEXEC` will be automatically
+ * closed in the child process. %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that
+ * other open file descriptors will be inherited by the child; otherwise all
+ * descriptors except stdin/stdout/stderr will be closed before calling exec()
+ * in the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
* absolute path, it will be looked for in the `PATH` environment
* variable. %G_SPAWN_SEARCH_PATH_FROM_ENVP means need not be an
* absolute path, it will be looked for in the `PATH` variable from
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]