aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/execvp.ccm
blob: 688ecb6af02a0f8f0712b0f8e140b32629b9e547 (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
26
27
28
/*
 * This source code is released into the public domain.
 */

module;

#include <string>
#include <expected>
#include <format>

export module nihil.posix:execvp;

import nihil.error;
import :argv;
import :exec;

namespace nihil {

/*
 * execvp: equivalent to fexecv(), except the command is passed as
 * a filename instead of a file descriptor.  If the filename is not
 * an absolute path, it will be searched for in $PATH.
 */

export [[nodiscard]] auto execvp(std::string_view file, argv &&argv)
	-> std::expected<base_executor_type, error>;

} // namespace nihil