MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / createStdNode

Function createStdNode

lib/host/wasi/inode-linux.cpp:164–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163namespace {
164WasiExpect<INode> createStdNode(int32_t Fd) {
165 if (Fd < 0) {
166 spdlog::error(" Invalid file descriptor: {}"sv, Fd);
167 return WasiUnexpect(__WASI_ERRNO_BADF);
168 }
169
170 if (fcntl(Fd, F_GETFD) == -1) {
171 spdlog::error(" Invalid file descriptor: {}"sv, Fd);
172 return WasiUnexpect(__WASI_ERRNO_BADF);
173 }
174
175 return INode(Fd, false);
176}
177} // namespace
178
179INode INode::stdIn() noexcept { return INode(STDIN_FILENO); }

Callers 1

fromFdMethod · 0.70

Calls 3

WasiUnexpectFunction · 0.85
errorFunction · 0.50
INodeFunction · 0.50

Tested by

no test coverage detected