MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / FileTable

Method FileTable

system/lib/wasmfs/file_table.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace wasmfs {
12
13FileTable::FileTable() {
14 entries.emplace_back();
15 (void)OpenFileState::create(
16 SpecialFiles::getStdin(), O_RDONLY, entries.back());
17 entries.emplace_back();
18 (void)OpenFileState::create(
19 SpecialFiles::getStdout(), O_WRONLY, entries.back());
20 entries.emplace_back();
21 (void)OpenFileState::create(
22 SpecialFiles::getStderr(), O_WRONLY, entries.back());
23}
24
25std::shared_ptr<OpenFileState> FileTable::Handle::getEntry(__wasi_fd_t fd) {
26 if (fd >= fileTable.entries.size() || fd < 0) {

Callers

nothing calls this directly

Calls 6

getStdinFunction · 0.85
getStdoutFunction · 0.85
getStderrFunction · 0.85
emplace_backMethod · 0.80
createFunction · 0.50
backMethod · 0.45

Tested by

no test coverage detected