Misc Fixes 10 (#781)

* libSceRazorCpu needed for gravity rush

* libSceCesCs needed for blue reflection

* clang format fix

* set scePadSetVibration to log debug

* initial sceNetCtl module implementation

* improved error codes in file system

* some intial work on netctl callbacks (helps a bit CUSA10135)

* misc

* improved callbacks handling in sceNetCtl

* small fixes

* added libSceRudp.sprx to lle modules

* draft work for npcallbacks
This commit is contained in:
georgemoralis 2024-09-11 16:48:16 +03:00 committed by GitHub
parent 1c0dfc60a1
commit 0ebae4ca6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 290 additions and 30 deletions

View file

@ -150,7 +150,6 @@ int PS4_SYSV_ABI posix_close(int d) {
return -1;
}
return result;
return ORBIS_OK;
}
size_t PS4_SYSV_ABI sceKernelWrite(int d, const void* buf, size_t nbytes) {
@ -367,8 +366,17 @@ s64 PS4_SYSV_ABI sceKernelPread(int d, void* buf, size_t nbytes, s64 offset) {
int PS4_SYSV_ABI sceKernelFStat(int fd, OrbisKernelStat* sb) {
LOG_INFO(Kernel_Fs, "(PARTIAL) fd = {}", fd);
if (fd < 3) {
return ORBIS_KERNEL_ERROR_EPERM;
}
if (sb == nullptr) {
return ORBIS_KERNEL_ERROR_EFAULT;
}
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
auto* file = h->GetFile(fd);
if (file == nullptr) {
return ORBIS_KERNEL_ERROR_EBADF;
}
std::memset(sb, 0, sizeof(OrbisKernelStat));
if (file->is_directory) {
@ -421,15 +429,24 @@ int PS4_SYSV_ABI sceKernelFtruncate(int fd, s64 length) {
}
static int GetDents(int fd, char* buf, int nbytes, s64* basep) {
// TODO error codes
ASSERT(buf != nullptr);
if (fd < 3) {
return ORBIS_KERNEL_ERROR_EBADF;
}
if (buf == nullptr) {
return ORBIS_KERNEL_ERROR_EFAULT;
}
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
auto* file = h->GetFile(fd);
if (file == nullptr) {
return ORBIS_KERNEL_ERROR_EBADF;
}
if (file->dirents_index == file->dirents.size()) {
return ORBIS_OK;
}
if (!file->is_directory || nbytes < 512 || file->dirents_index > file->dirents.size()) {
return ORBIS_KERNEL_ERROR_EINVAL;
}
const auto& entry = file->dirents.at(file->dirents_index++);
auto str = entry.name;
auto str_size = str.size() - 1;