/* * This source code is released into the public domain. */ module; #include #include #include "nihil.hh" export module nihil.posix:execl; import nihil.error; import :argv; import :execv; import :fexecv; namespace nihil { /* * execl: equivalent to (f)execv, except the arguments are passed as a * variadic pack of string-like objects. */ export [[nodiscard]] auto execl(std::string_view path, auto &&...args) -> execv { return execv(path, argv({std::string_view(args)...})); } #ifdef NIHIL_HAVE_FEXECVE export [[nodiscard]] auto execl(fd &&executable, auto &&...args) -> fexecv { return fexecv(std::move(executable), argv({std::string_view(args)...})); } #endif // NIHIL_HAVE_FEXECVE } // namespace nihil