aboutsummaryrefslogtreecommitdiffhomepage
path: root/postfork.h
diff options
context:
space:
mode:
Diffstat (limited to 'postfork.h')
-rw-r--r--postfork.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/postfork.h b/postfork.h
index 741e6369..9acd4c86 100644
--- a/postfork.h
+++ b/postfork.h
@@ -19,6 +19,15 @@
#include "wutil.h"
#include "io.h"
+#if HAVE_SPAWN_H
+#include <spawn.h>
+#endif
+
+#ifndef FISH_USE_POSIX_SPAWN
+ #define FISH_USE_POSIX_SPAWN HAVE_SPAWN_H
+#endif
+
+
/**
This function should be called by both the parent process and the
child right after fork() has been called. If job control is
@@ -44,6 +53,7 @@ int set_child_group( job_t *j, process_t *p, int print_errors );
\param j the job to set up the IO for
\param p the child process to set up
+ \param io_chain the IO chain to use (ignores the job's iochain)
\return 0 on sucess, -1 on failiure. When this function returns,
signals are always unblocked. On failiure, signal handlers, io
@@ -55,4 +65,12 @@ int setup_child_process( job_t *j, process_t *p );
*/
pid_t execute_fork(bool wait_for_threads_to_die);
+/** Report an error from failing to exec or posix_spawn a command */
+void safe_report_exec_error(int err, const char *actual_cmd, char **argv, char **envv);
+
+#if FISH_USE_POSIX_SPAWN
+/* Initializes and fills in a posix_spawnattr_t; on success, the caller should destroy it via posix_spawnattr_destroy */
+bool fork_actions_make_spawn_properties(posix_spawnattr_t *attr, posix_spawn_file_actions_t *actions, job_t *j, process_t *p);
+#endif
+
#endif