summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/forkfd/forkfd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/forkfd/forkfd.h')
-rw-r--r--src/3rdparty/forkfd/forkfd.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/3rdparty/forkfd/forkfd.h b/src/3rdparty/forkfd/forkfd.h
index 01b8882623..c987f8a7a9 100644
--- a/src/3rdparty/forkfd/forkfd.h
+++ b/src/3rdparty/forkfd/forkfd.h
@@ -39,6 +39,11 @@
#define FORKFD_H
#include <fcntl.h>
+#include <unistd.h> // to get the POSIX flags
+
+#ifdef _POSIX_SPAWN
+# include <spawn.h>
+#endif
#ifdef __cplusplus
extern "C" {
@@ -51,6 +56,14 @@ extern "C" {
int forkfd(int flags, pid_t *ppid);
+#ifdef _POSIX_SPAWN
+/* only for spawnfd: */
+# define FFD_SPAWN_SEARCH_PATH O_RDWR
+
+int spawnfd(int flags, pid_t *ppid, const char *path, const posix_spawn_file_actions_t *file_actions,
+ posix_spawnattr_t *attrp, char *const argv[], char *const envp[]);
+#endif
+
#ifdef __cplusplus
}
#endif