From 02926ee3447b1ea0d04b53b8fcb08d8b1a4deec5 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 30 Apr 2024 19:09:43 +0000 Subject: Add mspawn functions to cspawn.h; move everything to libenvexec Signed-off-by: Laurent Bercot --- src/libenvexec/child_spawn1_socket.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/libenvexec/child_spawn1_socket.c (limited to 'src/libenvexec/child_spawn1_socket.c') diff --git a/src/libenvexec/child_spawn1_socket.c b/src/libenvexec/child_spawn1_socket.c new file mode 100644 index 0000000..684842e --- /dev/null +++ b/src/libenvexec/child_spawn1_socket.c @@ -0,0 +1,16 @@ +/* ISC license. */ + +#include +#include +#include "cspawn-internal.h" + +pid_t child_spawn1_socket (char const *prog, char const *const *argv, char const *const *envp, int *fd) +{ + pid_t pid ; + int p[2] ; + if (ipc_pair_b(p) < 0) return 0 ; + pid = child_spawn1_internal(prog, argv, envp, p, 3) ; + if (!pid) return 0 ; + *fd = p[0] ; + return pid ; +} -- cgit v1.3.1