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

Function createStdNode

lib/host/wasi/inode-macos.cpp:134–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133namespace {
134WasiExpect<INode> createStdNode(int32_t Fd) {
135 if (Fd < 0) {
136 spdlog::error(" Invalid file descriptor: {}"sv, Fd);
137 return WasiUnexpect(__WASI_ERRNO_BADF);
138 }
139
140 if (fcntl(Fd, F_GETFD) == -1) {
141 spdlog::error(" Invalid file descriptor: {}"sv, Fd);
142 return WasiUnexpect(__WASI_ERRNO_BADF);
143 }
144
145 return INode(Fd, false);
146}
147} // namespace
148
149INode 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