mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibWasm/WASI: Make the premapped stdio files configurable
This commit is contained in:
parent
16dd8d4d3b
commit
f1abc36689
Notes:
sideshowbarker
2024-07-18 23:45:32 +09:00
Author: https://github.com/alimpfard
Commit: f1abc36689
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/671
1 changed files with 6 additions and 3 deletions
|
@ -827,6 +827,9 @@ struct Implementation {
|
||||||
Function<Vector<AK::String>()> provide_arguments;
|
Function<Vector<AK::String>()> provide_arguments;
|
||||||
Function<Vector<AK::String>()> provide_environment;
|
Function<Vector<AK::String>()> provide_environment;
|
||||||
Function<Vector<MappedPath>()> provide_preopened_directories;
|
Function<Vector<MappedPath>()> provide_preopened_directories;
|
||||||
|
int stdin_fd { 0 };
|
||||||
|
int stdout_fd { 1 };
|
||||||
|
int stderr_fd { 2 };
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit Implementation(Details&& details)
|
explicit Implementation(Details&& details)
|
||||||
|
@ -835,9 +838,9 @@ struct Implementation {
|
||||||
, provide_preopened_directories(move(details.provide_preopened_directories))
|
, provide_preopened_directories(move(details.provide_preopened_directories))
|
||||||
{
|
{
|
||||||
// Map all of std{in,out,err} by default.
|
// Map all of std{in,out,err} by default.
|
||||||
m_fd_map.insert(0, 0);
|
m_fd_map.insert(0, details.stdin_fd);
|
||||||
m_fd_map.insert(1, 1);
|
m_fd_map.insert(1, details.stdout_fd);
|
||||||
m_fd_map.insert(2, 2);
|
m_fd_map.insert(2, details.stderr_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<HostFunction> function_by_name(StringView);
|
ErrorOr<HostFunction> function_by_name(StringView);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue