shadPS4/src/core
Stephen Miller 6c39bf229c
libkernel: Various filesystem fixes (#2868)
* Proper handling of whence 3 & 4

* Accurate directory handling in open

Directories can be opened, and can be created in open, these changes should handle that more accurately.

* Mount /app0 as read only

On real hardware, it's read only.

* Proper directory flag handling.

Even when directory is specified, it will still succeed to open non-directories.

* Check for read only directories

* Earlier ro check in posix_rmdir

Hardware tests suggest these checks are in a different order

* Clear temp folder on boot

My tests rely on this, and some games do too.
Two birds with one stone

* Clang

* Add missing DeleteHandle calls

Whoops

* Final flags adjustment in sceKernelOpen

All my current tests are now hardware accurate.

* Fix truncates

Host ftruncate consistently fails on EINVAL, I'll need to test if this issue affected Windows too.

* Windows hacks

Windows is more limiting about how folders are opened and things like that. For now, pretend these calls didn't error.
Also fixes compilation for Windows

* Final touch-ups

After expanding my test suite further, I found a couple more edge cases that needed addressing.
Bloodborne audio is still broken, I'll look into that soon.

* Remove hacky read-only behavior in posix_stat

Bloodborne apparently uses the mode parameter here when querying it's audio files, and the mode we returned led to it disabling audio entirely.

* Clang

* Cleaner code

* Combine fsync and sync flags

According to FreeBSD docs, the "sync" flag is synonymous with the fsync flag, and is only included to meet the POSIX spec.

* Log if any currently unhandled flags are encountered.

These are rare and probably not too important, but log a warning when they're seen.

* Update file_system.cpp

* Update file_system.cpp

* Clang

* Revert truncate fix

Using ftruncate works fine after moving the call to before the proper file opening code.

* Truncate before open

Open the file as read-write, then try truncating.
This fixes read | truncate flag behavior on Windows.

* Slightly adjust check for invalid flags

Any open call with invalid flags should return EINVAL, regardless of other errors parameters might cause.
2025-05-01 14:47:43 +03:00
..
aerolib fix typo in LOG_INFO (#559) 2024-08-26 15:22:11 +03:00
devices fix: Add missing ctime includes. 2025-04-30 23:37:37 -07:00
devtools fix: Add missing ctime includes. 2025-04-30 23:37:37 -07:00
file_format externals: Remove need for cryptopp build. (#2707) 2025-03-29 10:32:06 +02:00
file_sys Handle "-patch" as the suffix for game update folders (#2674) 2025-03-23 23:24:49 +02:00
libraries libkernel: Various filesystem fixes (#2868) 2025-05-01 14:47:43 +03:00
loader Fix path bugs & wrap seeks in an if (#1154) 2024-09-30 12:42:59 +03:00
address_space.cpp address_space: Split macOS reserved memory region. (#2372) 2025-02-08 13:21:32 -08:00
address_space.h renderer_vulkan: Commize and adjust buffer bindings (#1412) 2024-10-19 15:30:58 +03:00
cpu_patches.cpp cpu_patches: Remove CPU patches for macOS and bump minimum OS version to 15.4 (#2743) 2025-04-03 22:39:08 +03:00
cpu_patches.h cpu_patches: Remove CPU patches for macOS and bump minimum OS version to 15.4 (#2743) 2025-04-03 22:39:08 +03:00
debug_state.cpp Fix showing debug menu bar / Devtools (#2214) 2025-01-22 22:21:41 -03:00
debug_state.h FidelityFX FSR implementation (#2624) 2025-03-12 20:33:30 +02:00
linker.cpp Revert libSceGnmDriver initialization emulation (#2816) 2025-04-20 18:26:52 +03:00
linker.h Implement sceKernelGetModuleInfo, sceKernelGetModuleInfoInternal, and sceKernelGetModuleList (#2850) 2025-04-27 09:32:01 +03:00
memory.cpp sceKernelAllocateDirectMemory hotfixes (#2838) 2025-04-24 12:21:14 -07:00
memory.h memory: Implement protecting multiple VMAs (#2484) 2025-02-21 08:28:47 +02:00
module.cpp Implement sceKernelGetModuleInfo, sceKernelGetModuleInfoInternal, and sceKernelGetModuleList (#2850) 2025-04-27 09:32:01 +03:00
module.h libkernel: improve module finding in sceKernelLoadStartModule (#2541) 2025-03-09 23:44:17 +02:00
platform.h Support for Vulkan 1.4 (#1665) 2024-12-07 19:41:41 +02:00
signals.cpp Bump to Clang 19 (#2434) 2025-02-18 15:55:13 +02:00
signals.h Patch extrq (#943) 2024-09-23 19:19:52 +03:00
thread.cpp exception: Fix raising exceptions on POSIX systems (#1868) 2024-12-25 00:21:32 +02:00
thread.h Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
tls.cpp cpu_patches: Remove CPU patches for macOS and bump minimum OS version to 15.4 (#2743) 2025-04-03 22:39:08 +03:00
tls.h core/libraries: HLE fiber reimplementation (#1836) 2024-12-24 13:33:00 +01:00