1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:07:34 +00:00

LibCore: Add System::exec_command method

This method was taken from the pls utility and its purpose is to execute
a given command with all the required requirements such as providing a
suitable exec environment.
This commit is contained in:
Liav A 2022-11-04 11:50:40 +02:00 committed by Andrew Kaster
parent 942e262e86
commit 0d1af1ad63
2 changed files with 28 additions and 0 deletions

View file

@ -165,6 +165,11 @@ enum class SearchInPath {
No,
Yes,
};
#ifdef AK_OS_SERENITY
ErrorOr<void> exec_command(Vector<StringView>& command, bool preserve_env);
#endif
ErrorOr<void> exec(StringView filename, Span<StringView> arguments, SearchInPath, Optional<Span<StringView>> environment = {});
ErrorOr<int> socket(int domain, int type, int protocol);