aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/exec.ccm
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-30 07:51:23 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-30 07:51:23 +0100
commit034cd404a129103a8dd7747e6bd00ffd5550da93 (patch)
treed27946517d4d9333abd26ac50bbd4a436093e2ce /nihil.posix/exec.ccm
parent3e7902f7d790a486d3d9cb978df193f07f3a6ad9 (diff)
downloadnihil-034cd404a129103a8dd7747e6bd00ffd5550da93.tar.gz
nihil-034cd404a129103a8dd7747e6bd00ffd5550da93.tar.bz2
refactoring
Diffstat (limited to 'nihil.posix/exec.ccm')
-rw-r--r--nihil.posix/exec.ccm53
1 files changed, 0 insertions, 53 deletions
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 <expected>
-#include <string>
-
-#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<base_executor_type, error>
-{
- 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<base_executor_type, error>;
-
-} // namespace nihil