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

Method pathOpen

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

Source from the content-addressed store, hash-verified

744}
745
746WasiExpect<INode> INode::pathOpen(std::string Path, __wasi_oflags_t OpenFlags,
747 __wasi_fdflags_t FdFlags,
748 VFS::Flags VFSFlags) const noexcept {
749 const int Flags = openFlags(OpenFlags, FdFlags, VFSFlags);
750
751 if (auto NewFd = ::openat(Fd, Path.c_str(), Flags, 0644);
752 unlikely(NewFd < 0)) {
753 return WasiUnexpect(fromErrNo(errno));
754 } else {
755 INode New(NewFd);
756
757#ifndef O_CLOEXEC
758 if (auto Res = ::fcntl(New.Fd, F_SETFD, FD_CLOEXEC); unlikely(Res != 0)) {
759 return WasiUnexpect(fromErrNo(errno));
760 }
761#endif
762 return New;
763 }
764}
765
766WasiExpect<void> INode::pathReadlink(std::string Path, Span<char> Buffer,
767 __wasi_size_t &NRead) const noexcept {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected