aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/execlp.ccm
blob: 02f9f6fb88ce8d809722f9995c60159b3ff4eafe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// This source code is released into the public domain.
export module nihil.posix:execlp;

import nihil.std;
import nihil.core;

import :argv;
import :execvp;

namespace nihil {

// execlp: equivalent to execvp, except the arguments are passed as a
// variadic pack of string-like objects.

export [[nodiscard]] auto
execlp(std::filesystem::path const &file, auto &&...args) -> std::expected<execv, error>
{
	return execvp(file, argv({std::string_view(args)...}));
}

} // namespace nihil