From 4e07f5c2e13ab8bdf2e25ed1711f68db079b1f59 Mon Sep 17 00:00:00 2001 From: marecl Date: Fri, 7 Nov 2025 11:07:06 +0100 Subject: [PATCH] qweqwe --- src/core/file_sys/hostio/src/host_io_win32.cpp | 14 ++++++++++++++ .../file_sys/quasifs/src/quasifs_vdriver.cpp | 18 +++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/core/file_sys/hostio/src/host_io_win32.cpp b/src/core/file_sys/hostio/src/host_io_win32.cpp index a37273042..df8b91c7e 100644 --- a/src/core/file_sys/hostio/src/host_io_win32.cpp +++ b/src/core/file_sys/hostio/src/host_io_win32.cpp @@ -103,6 +103,13 @@ s64 HostIO_Win32::PRead(const s32 fd, void* buf, u64 count, u64 offset) { return status >= 0 ? status : -errno; } +s64 HostIO_Win32::ReadV(const s32 fd, OrbisKernelIovec* iov, u32 iovcnt) { + return 0; +} +s64 HostIO_Win32::PReadV(const s32 fd, OrbisKernelIovec* iov, u32 iovcnt, s64 offset) { + return 0; +} + s64 HostIO_Win32::Write(const s32 fd, const void* buf, u64 count) { errno = 0; s32 status = _write(fd, buf, count); @@ -122,6 +129,13 @@ s64 HostIO_Win32::PWrite(const s32 fd, const void* buf, u64 count, u64 offset) { return status >= 0 ? status : -errno; } +s64 HostIO_Win32::WriteV(const s32 fd, const OrbisKernelIovec* iov, u32 iovcnt) { + return 0; +} +s64 HostIO_Win32::PWriteV(const s32 fd, const OrbisKernelIovec* iov, u32 iovcnt, s64 offset) { + return 0; +} + s32 HostIO_Win32::MKDir(const fs::path& path, u16 mode) { errno = 0; s32 status = _wmkdir(path.c_str()); diff --git a/src/core/file_sys/quasifs/src/quasifs_vdriver.cpp b/src/core/file_sys/quasifs/src/quasifs_vdriver.cpp index 2403053de..cc24b66ee 100644 --- a/src/core/file_sys/quasifs/src/quasifs_vdriver.cpp +++ b/src/core/file_sys/quasifs/src/quasifs_vdriver.cpp @@ -130,7 +130,9 @@ s32 QFS::OperationImpl::Close(s32 fd) { LOG_ERROR(Kernel_Fs, "Closing std stream, this will have consequences fd={}", fd); // if it fails, it fails - int hio_status = qfs.hio_driver.Close(handle->host_fd); + int hio_status = 0; + if (handle->host_fd >= 0) + hio_status = qfs.hio_driver.Close(handle->host_fd); // no further action is required, this is pro-forma qfs.vio_driver.Close(fd); @@ -193,7 +195,7 @@ s32 QFS::OperationImpl::LinkSymbolic(const fs::path& src, const fs::path& dst) { host_used = true; } else if (dst_part->IsHostMounted() ^ src_part->IsHostMounted()) { LOG_ERROR(Kernel_Fs, - "Symlinks can be only created if both source and destination are host-bound"); + "Symlinks can be only created on the same type of partition (virtual/host)"); return -QUASI_ENOSYS; } @@ -227,6 +229,12 @@ s32 QFS::OperationImpl::Link(const fs::path& src, const fs::path& dst) { partition_ptr src_part = src_res.mountpoint; partition_ptr dst_part = dst_res.mountpoint; + if (src_part != dst_part) { + LOG_ERROR(Kernel_Fs, "Hard links can only be created within one partition"); + // I think this is the right error + return -QUASI_ENOSYS; + } + if (qfs.IsPartitionRO(dst_part)) return -QUASI_EROFS; @@ -234,7 +242,7 @@ s32 QFS::OperationImpl::Link(const fs::path& src, const fs::path& dst) { int hio_status = 0; int vio_status = 0; - if (dst_part->IsHostMounted() && src_part->IsHostMounted()) { + if (dst_part->IsHostMounted()) { fs::path host_path_src{}; fs::path host_path_dst{}; @@ -249,10 +257,6 @@ s32 QFS::OperationImpl::Link(const fs::path& src, const fs::path& dst) { // hosts operation must succeed in order to continue return hio_status; host_used = true; - } else if (dst_part->IsHostMounted() ^ src_part->IsHostMounted()) { - LOG_ERROR(Kernel_Fs, - "Links can be only created if both source and destination are host-bound"); - return -QUASI_ENOSYS; } qfs.vio_driver.SetCtx(&src_res, host_used, nullptr);