| 744 | } |
| 745 | |
| 746 | WasiExpect<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 | |
| 766 | WasiExpect<void> INode::pathReadlink(std::string Path, Span<char> Buffer, |
| 767 | __wasi_size_t &NRead) const noexcept { |
nothing calls this directly
no test coverage detected