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

LibCore: Add a wrapper for execvpe() and friends

This is a single function, which behaves like the various LibC exec()
functions depending on the passed parameters. No direct equivalent is
made for execl() - you have to wrap your arguments in a Span of some
kind.

On Serenity, this calls the syscall directly, whereas Lagom forwards to
the appropriate LibC function.
This commit is contained in:
Sam Atkins 2022-03-12 20:23:43 +00:00 committed by Andreas Kling
parent b4c6fd51be
commit 32ab09a930
2 changed files with 130 additions and 1 deletions

View file

@ -127,6 +127,11 @@ ErrorOr<void> utime(StringView path, Optional<struct utimbuf>);
ErrorOr<struct utsname> uname();
ErrorOr<Array<int, 2>> pipe2(int flags);
ErrorOr<void> adjtime(const struct timeval* delta, struct timeval* old_delta);
enum class SearchInPath {
No,
Yes,
};
ErrorOr<void> exec(StringView filename, Span<StringView> arguments, SearchInPath, Optional<Span<StringView>> environment = {});
ErrorOr<int> socket(int domain, int type, int protocol);
ErrorOr<void> bind(int sockfd, struct sockaddr const*, socklen_t);