mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:27:35 +00:00
LibWasm: Keep track of created directory fds in path_create_directory
This commit is contained in:
parent
5121b368cd
commit
47248a3511
3 changed files with 9 additions and 0 deletions
|
@ -478,6 +478,10 @@
|
|||
# cmakedefine01 WASI_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef WASI_FINE_GRAINED_DEBUG
|
||||
# cmakedefine01 WASI_FINE_GRAINED_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef WASM_BINPARSER_DEBUG
|
||||
# cmakedefine01 WASM_BINPARSER_DEBUG
|
||||
#endif
|
||||
|
|
|
@ -197,6 +197,7 @@ set(VPX_DEBUG ON)
|
|||
set(WAITBLOCK_DEBUG ON)
|
||||
set(WAITQUEUE_DEBUG ON)
|
||||
set(WASI_DEBUG ON)
|
||||
set(WASI_FINE_GRAINED_DEBUG ON)
|
||||
set(WASM_BINPARSER_DEBUG ON)
|
||||
set(WASM_TRACE_DEBUG ON)
|
||||
set(WASM_VALIDATOR_DEBUG ON)
|
||||
|
|
|
@ -636,12 +636,16 @@ ErrorOr<Result<FD>> Implementation::impl$path_open(Configuration& configuration,
|
|||
auto path_data = TRY(slice_typed_memory(configuration, path, path_len));
|
||||
auto path_string = DeprecatedString::copy(path_data);
|
||||
|
||||
dbgln_if(WASI_FINE_GRAINED_DEBUG, "path_open: dir_fd={}, path={}, open_flags={}", dir_fd, path_string, open_flags);
|
||||
|
||||
int opened_fd = openat(dir_fd, path_string.characters(), open_flags, 0644);
|
||||
if (opened_fd < 0)
|
||||
return errno_value_from_errno(errno);
|
||||
|
||||
// FIXME: Implement Rights and RightsInheriting.
|
||||
|
||||
m_fd_map.insert(opened_fd, static_cast<u32>(opened_fd));
|
||||
|
||||
return FD(opened_fd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue