From 034cd404a129103a8dd7747e6bd00ffd5550da93 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Mon, 30 Jun 2025 07:51:23 +0100 Subject: refactoring --- nihil.posix/exec.ccm | 53 ---------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 nihil.posix/exec.ccm (limited to 'nihil.posix/exec.ccm') diff --git a/nihil.posix/exec.ccm b/nihil.posix/exec.ccm deleted file mode 100644 index cd03117..0000000 --- a/nihil.posix/exec.ccm +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This source code is released into the public domain. - */ - -module; - -/* - * Exec providers, mostly used for spawn(). - */ - -#include -#include - -#include "nihil.hh" - -export module nihil.posix:exec; - -import nihil.error; -import :execv; -import :fexecv; -import :argv; -import :fd; - -namespace nihil { - -/* - * The lowest-level executor type, which is returned by other executors. - * Prefer fexecve() if it's available, otherwise use execve(). - */ -#ifdef NIHIL_HAVE_FEXECVE -using base_executor_type = fexecv; -#else -using base_executor_type = execv; -#endif - -/* - * execl: equivalent to execv, except the arguments are passed as a - * variadic pack of string-like objects. - */ -export [[nodiscard]] auto execl(std::string_view path, auto &&...args) - -> std::expected -{ - return execv(path, argv({std::string_view(args)...})); -} - -/* - * shell: run the process by invoking /bin/sh -c with the single argument, - * equivalent to system(3). - */ -export [[nodiscard]] auto shell(std::string_view const &command) - -> std::expected; - -} // namespace nihil -- cgit v1.2.3