mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-06 17:54:59 -06:00
qweqwe
This commit is contained in:
parent
a6284da10a
commit
4e07f5c2e1
@ -103,6 +103,13 @@ s64 HostIO_Win32::PRead(const s32 fd, void* buf, u64 count, u64 offset) {
|
|||||||
return status >= 0 ? status : -errno;
|
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) {
|
s64 HostIO_Win32::Write(const s32 fd, const void* buf, u64 count) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
s32 status = _write(fd, buf, count);
|
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;
|
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) {
|
s32 HostIO_Win32::MKDir(const fs::path& path, u16 mode) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
s32 status = _wmkdir(path.c_str());
|
s32 status = _wmkdir(path.c_str());
|
||||||
|
|||||||
@ -130,7 +130,9 @@ s32 QFS::OperationImpl::Close(s32 fd) {
|
|||||||
LOG_ERROR(Kernel_Fs, "Closing std stream, this will have consequences fd={}", fd);
|
LOG_ERROR(Kernel_Fs, "Closing std stream, this will have consequences fd={}", fd);
|
||||||
|
|
||||||
// if it fails, it fails
|
// 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
|
// no further action is required, this is pro-forma
|
||||||
qfs.vio_driver.Close(fd);
|
qfs.vio_driver.Close(fd);
|
||||||
@ -193,7 +195,7 @@ s32 QFS::OperationImpl::LinkSymbolic(const fs::path& src, const fs::path& dst) {
|
|||||||
host_used = true;
|
host_used = true;
|
||||||
} else if (dst_part->IsHostMounted() ^ src_part->IsHostMounted()) {
|
} else if (dst_part->IsHostMounted() ^ src_part->IsHostMounted()) {
|
||||||
LOG_ERROR(Kernel_Fs,
|
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;
|
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 src_part = src_res.mountpoint;
|
||||||
partition_ptr dst_part = dst_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))
|
if (qfs.IsPartitionRO(dst_part))
|
||||||
return -QUASI_EROFS;
|
return -QUASI_EROFS;
|
||||||
|
|
||||||
@ -234,7 +242,7 @@ s32 QFS::OperationImpl::Link(const fs::path& src, const fs::path& dst) {
|
|||||||
int hio_status = 0;
|
int hio_status = 0;
|
||||||
int vio_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_src{};
|
||||||
fs::path host_path_dst{};
|
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
|
// hosts operation must succeed in order to continue
|
||||||
return hio_status;
|
return hio_status;
|
||||||
host_used = true;
|
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);
|
qfs.vio_driver.SetCtx(&src_res, host_used, nullptr);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user