summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-16 15:34:44 +0000
committermidipix <writeonce@midipix.org>2024-03-16 15:34:44 +0000
commitc8ac943463470e1486a061a65943b2be859ba2df (patch)
tree479b8e81265020bf02b447b0cf9cd827290aa8b4 /src/internal
parent7ff9431e77e9966c19c8fcda06a0de2a750efe09 (diff)
downloadslibtool-c8ac943463470e1486a061a65943b2be859ba2df.tar.bz2
slibtool-c8ac943463470e1486a061a65943b2be859ba2df.tar.xz
simple process creation: midipix targets: utilize the fast and robust vfork().
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/slibtool_spawn_impl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/internal/slibtool_spawn_impl.h b/src/internal/slibtool_spawn_impl.h
index 93df1cd..aa4ea35 100644
--- a/src/internal/slibtool_spawn_impl.h
+++ b/src/internal/slibtool_spawn_impl.h
@@ -30,6 +30,12 @@
#include <spawn.h>
#endif
+#ifdef __midipix__
+static pid_t slbt_fork(void) {return vfork();}
+#else
+static pid_t slbt_fork(void) {return fork();}
+#endif
+
static inline int slbt_spawn(
struct slbt_exec_ctx * ectx,
bool fwait)
@@ -56,6 +62,8 @@ static inline int slbt_spawn(
#endif
+ (void)slbt_fork;
+
if (pid < 0) {
ectx->pid = pid;
ectx->exitcode = errno;