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

Method open

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

Source from the content-addressed store, hash-verified

155WasiExpect<INode> INode::fromFd(int32_t Fd) { return createStdNode(Fd); }
156
157WasiExpect<INode> INode::open(std::string Path, __wasi_oflags_t OpenFlags,
158 __wasi_fdflags_t FdFlags,
159 VFS::Flags VFSFlags) noexcept {
160 const int Flags = openFlags(OpenFlags, FdFlags, VFSFlags);
161
162 if (auto NewFd = ::open(Path.c_str(), Flags, 0644); unlikely(NewFd < 0)) {
163 return WasiUnexpect(fromErrNo(errno));
164 } else {
165 return INode(NewFd);
166 }
167}
168
169WasiExpect<void> INode::fdAdvise(__wasi_filesize_t, __wasi_filesize_t,
170 __wasi_advice_t) const noexcept {

Callers

nothing calls this directly

Calls 6

unlikelyFunction · 0.85
WasiUnexpectFunction · 0.85
c_strMethod · 0.80
openFlagsFunction · 0.70
fromErrNoFunction · 0.70
INodeFunction · 0.50

Tested by

no test coverage detected