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

import nihil.std;
import nihil.error;
import :argv;
import :execv;
import :fd;

namespace nihil {

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

export [[nodiscard]] auto execl(std::filesystem::path path, auto &&...args) -> execv
{
	return execv(std::move(path), argv({std::string_view(args)...}));
}

export [[nodiscard]] auto execl(fd &&executable, auto &&...args) -> execv
{
	return execv(std::move(executable), argv({std::string_view(args)...}));
}

} // namespace nihil