From c8ac943463470e1486a061a65943b2be859ba2df Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 16 Mar 2024 15:34:44 +0000 Subject: simple process creation: midipix targets: utilize the fast and robust vfork(). --- src/internal/slibtool_spawn_impl.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/internal') 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 #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; -- cgit v1.2.3