AnyPS5/core/libs
boykopovar 73d014ed83
Merge pull request #56 from oneandonlydean/feat/linux-pread-getdents
feat(libkernel): pread, pwrite, getdents and getdirentries on linux
- **pread/pwrite:** use the existing `NativePread`/`NativePwrite` and don't move the file offset. A null buffer with a non-zero size returns `EFAULT`, a negative offset `EINVAL`, and host failures go through `SceErrorFromErrno`.
- **getdirentries:**
  - reads host `getdents64` records and converts them to the FreeBSD `struct dirent` layout the guest expects (`d_fileno` u32, `d_reclen` u16, `d_type` u8, `d_namlen` u8, NUL-terminated name, record padded to 4 bytes);
  - `*basep` gets the directory position from before the read;
  - when a record doesn't fit in the guest buffer, the descriptor is moved with `lseek` back to that entry's cookie, so the next call resumes there;
  - if not even the first record fits, the call returns `EINVAL` without consuming anything, and a name longer than 255 bytes returns `ENAMETOOLONG`.
- **getdents** is `getdirentries` without `basep`.
- Adds the guest `EFAULT`, `EINVAL` and `ENAMETOOLONG` constants.
2026-09-28 09:38:47 +03:00
..
nid fix: correct sscanf %x signedness and avoid a substr copy 2026-09-26 14:11:50 -06:00
prx Merge pull request #56 from oneandonlydean/feat/linux-pread-getdents 2026-09-28 09:38:47 +03:00
tests Merge pull request #56 from oneandonlydean/feat/linux-pread-getdents 2026-09-28 09:38:47 +03:00
CMakeLists.txt Merge pull request #56 from oneandonlydean/feat/linux-pread-getdents 2026-09-28 09:38:47 +03:00
SceShaders.hpp feat(libs): libSce types impl + shaders refactor 2026-09-08 10:20:57 +03:00
SceTypes.hpp feat(libkernel): implement application heap and thread atexit registration 2026-09-27 11:43:33 +03:00