Commit Graph
554 Commits
Author SHA1 Message Date
Dean 165d818a8f Merge pull request #14874 from roboterspinne/fix/libkernel-path-name-too-long-errors
fix(libkernel): fail sce path calls with ENAMETOOLONG for a path of 1024 bytes or more
2026-11-03 18:11:05 +13:00
Dean 10921ef452 Merge pull request #12560 from Kikoarl/fix/win32-verbatim-path-dos-devices
fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows
2026-11-03 18:09:19 +13:00
Dean 99e565963e Merge pull request #10319 from MarrasFederico/fix/open-create-trailing-slash
fix(libkernel): report lookup errors when creating through a trailing slash
2026-11-03 11:34:52 +13:00
Kikoarl ae9a8b093d fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows 2026-11-02 21:16:21 +01:00
Dean 36896d8a7f Merge pull request #14206 from JJenkx/windows/libkernel-select-close-race
fix(libkernel): fail a select with EBADF when its pipe closes during the wait on Windows
2026-11-03 08:46:47 +13:00
Dean c05a68628b Merge pull request #10014 from xXPBSXx/fix/kqueue-descriptor-read-write-seek-sync
fix(libkernel): answer read, write, lseek, fsync and flock on a kqueue descriptor as FreeBSD does
2026-11-03 06:26:53 +13:00
Federico Marras d683cc901a Merge main into fix/open-create-trailing-slash 2026-11-02 18:25:10 +01:00
Dean 3258c2f513 Merge pull request #12820 from JJenkx/windows/libkernel-unlink-dangling-dir-link
fix(libkernel): unlink a dangling Windows directory link
2026-11-03 05:13:40 +13:00
xXPBSXxandClaude Sonnet 5.5 c9abed0516 Merge main (24238c4cb1) into fix/kqueue-descriptor-read-write-seek-sync
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 13:19:19 +01:00
Dean 95175b5acf Merge pull request #11298 from Gruzzberry/fix/dangling-link-prefix-enoent
fix(libkernel): fail with ENOENT for a path below a dangling Windows symbolic link
2026-11-02 23:27:36 +13:00
Dean 859db5cd22 Merge pull request #10979 from xXPBSXx/fix/pipe-efault
fix(libkernel): fail pipe with EFAULT and close both descriptors when the descriptor array is not writable guest memory
2026-11-02 23:26:26 +13:00
Dean fc3a5af62c Merge pull request #10755 from Ragbie/fix/windows-fclose-descriptor-state
fix(libc): drop the kernel state of a descriptor that fclose or freopen closes
2026-11-02 23:24:14 +13:00
Dean b07388b060 Merge pull request #10552 from krishalivaibhav/fix/macos-libkernel-six
fix(libkernel): build the file, module and rtld calls on macOS hosts
2026-11-02 20:54:13 +13:00
JJenkx 79e6d32c05 fix(libkernel): unlink a dangling Windows directory link 2026-11-01 20:17:24 -05:00
xXPBSXxandClaude Sonnet 5.5 66cac964ab Merge main (66e1f7f993) into fix/pipe-efault
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 01:08:41 +01:00
roboterspinne 2de34f87bf fix(libkernel): fail sce path calls with ENAMETOOLONG for a path of 1024 bytes or more 2026-11-01 21:57:49 +01:00
Adrià ac26e59d9a Merge pull request #13901 from DeveshB-1/fix/stat-archived-efault
fix(libkernel): return EFAULT from stat for an unwritable buffer
2026-11-01 15:13:30 +01:00
Dean c51c471250 Merge pull request #12922 from ntamas94/fix/ps4-dir-blksize
fix(libkernel): report a 64 KiB st_blksize for directories
2026-11-02 00:25:59 +13:00
Dean e56c5c99f3 Merge pull request #12474 from milescoviello/fix/fcntl-host-descriptor
fix(libkernel): report a host-only descriptor as not open to fcntl and ioctl
2026-11-01 23:38:28 +13:00
DeveshB-1 b5ffde4a0a fix(libkernel): return EFAULT from stat for an unwritable buffer 2026-11-01 14:18:08 +05:30
ntamas94 249d8cc371 Merge remote-tracking branch 'origin/main' into fix/ps4-dir-blksize 2026-11-01 07:53:32 +01:00
GruzzberryandClaude Sonnet 5.5 2d1342cf31 fix(libkernel): fail chflags and fchflags with EPERM when a system flag changes
FreeBSD 11.4 ufs_setattr refuses a change of any SF_* flag to a caller without PRIV_VFS_SYSFLAGS, which prison_priv_check denies a jailed root without allow.chflags. Under the credential model agreed on #11216 every SF_* flag now fails with EPERM, after the EOPNOTSUPP check for unknown bits, instead of throwing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 07:51:40 +01:00
Dean 9f6d3b910c Merge pull request #7202 from MarcZX10/codex/lstat-long-windows-path-7201
fix(libkernel): support lstat on long Windows paths
2026-11-01 19:19:37 +13:00
Dean Galvin 833af84aec Merge main into fix/open-create-trailing-slash 2026-11-01 18:45:38 +13:00
JJenkxandClaude Opus 5.5 6157b85375 fix(libkernel): fail a select with EBADF when its pipe closes during the wait on Windows
On Windows, closing a pipe while another thread waited for it in select
terminated the process. The close releases the host handle before the C
runtime descriptor, so in between:

- the readiness query of the pipe failed on the dead handle and threw
  'querying pipe descriptor ... failed';
- after that, DescriptorIsOpen still saw the descriptor mapped, select
  looked it up again, found no known kind and threw 'is neither a
  socket, a pipe, ...'.

QueryPipe now reports a descriptor whose handle is no longer a pipe as
not a pipe instead of throwing, DescriptorIsOpen on Windows also checks
that the mapped handle is still valid, and select answers EBADF for such
a descriptor before throwing for an unknown kind, as FreeBSD 11.4's
kern_select does for a descriptor closed during the wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 19:19:53 -04:00
JJenkxandClaude Opus 5.5 b476f50b8e fix(libkernel): unlink a dangling Windows directory symbolic link
sceKernelUnlink takes its Windows directory-link path only when
std::filesystem::symlink_status reports a directory, but MinGW's
symlink_status follows the link. A directory symbolic link whose target
is missing therefore looked like a file, went to the file delete, and
failed with EACCES, because Windows removes a directory link only
through RemoveDirectoryW. guest_filesystem stops there on any Windows
host that may create symbolic links.

The directory path is now also taken when the link itself carries both
FILE_ATTRIBUTE_DIRECTORY and FILE_ATTRIBUTE_REPARSE_POINT, which
GetFileAttributesW reports without following the link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 18:57:56 -04:00
GruzzberryandClaude Sonnet 5.5 bfef134a9a fix(libkernel): fail with ENOENT for a path below a dangling Windows symbolic link
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 10:16:00 +00:00
krishalivaibhavandClaude Opus 5.5 32d288095f fix(libkernel): drop leading slashes after a long-path split on macOS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 14:32:54 +05:30
krishalivaibhavandClaude Opus 5.5 f58b1c4523 refactor(libkernel): resolve the macOS temporary directory once for shared memory
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
krishalivaibhavandClaude Opus 5.5 f374a777a2 fix(libkernel): read archived directories through getdirentries on macOS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
krishalivaibhavandClaude Opus 5.5 787e08bb5c fix(libkernel): match macOS shared memory only in the temporary directory
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
krishalivaibhavandClaude Opus 5.5 fa9d3c8088 fix(libkernel): check the descriptor before an empty vector read or write on macOS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
krishalivaibhavandClaude Opus 5.5 e95186ba55 fix(libkernel): treat only unnamed FIFOs as pipes on macOS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
krishalivaibhavandClaude Sonnet 5.5 5200c2edd2 fix(libkernel): report named shm_open and shm_unlink as not implemented on macOS
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
Himansh Raj 559568f8d8 fix(libkernel): guard getdirentries guest outputs on macOS
The macOS sceKernelGetdirentries wrote *basep and the entry records into buf
without entering GuestArena::HostWrite, so the write-watch host-write path
never saw those writes. It now opens HostWrite guards for buf over nbytes and
for basep before it moves the descriptor offset, and holds them through every
write, as the Linux path does. It also rejects a non-directory with EINVAL
before the guards, matching Linux.
2026-10-31 14:32:53 +05:30
Himansh Raj ee34c291e1 fix(libkernel): open long-path stat prefixes with O_SEARCH on macOS
The long-path fallback in NativeStat opened each intermediate directory with
O_RDONLY | O_DIRECTORY, which needs read permission on it. stat and fstatat
only need search permission, so a path through an execute-only directory
failed with EACCES once it crossed PATH_MAX. O_SEARCH (O_EXEC | O_DIRECTORY
on Darwin) needs only search permission and still rejects a non-directory.
2026-10-31 14:32:53 +05:30
c5a398fb03 fix(libkernel): find a directory descriptor's path through F_GETPATH on macOS
Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
0e145b86e1 fix(libkernel): build the file, module and rtld calls on macOS hosts
NativeStat, SharedMemory, Stdio, DynamicLoader, ModuleInfo and Rtld used
Linux-only APIs (st_atim, memfd_create, sys/vfs.h, link.h and dl_iterate_phdr),
so libkernel did not compile on macOS. Add macOS paths behind __APPLE__:
st_*timespec and a long-path fstatat walk, an unlinked temp file for shared
memory, statfs, dlopen/dladdr and Mach-O segment walks for module and rtld
queries. The Linux and Windows paths are unchanged.

Extracted from feat/macos-port (#8658).

Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
DeveshB-1 5553cbd447 fix(libkernel): return EFAULT from sceKernelWriteThrottlingStatus for an unwritable store 2026-10-30 20:14:03 +05:30
Dean 5c0ee1bbf4 Merge pull request #11827 from oneandonlydean/carry/7268-cert-paths
feat(libkernel): provide system and common certificate list paths
2026-10-31 01:18:08 +13:00
Adrià 8304ccaedb Merge pull request #11341 from SteelCrab/review/emscripten-libraries
build(libs): support Emscripten memory64 compilation
2026-10-30 12:49:20 +01:00
Dean Galvin 462c4ec0aa Merge main into PR #11827 2026-10-30 23:07:47 +13:00
Adrià 0a2cda921d Merge pull request #12933 from heditrigui/feat/libc-dprintf
feat(libc): implement dprintf and vdprintf
2026-10-30 06:33:00 +01:00
pista d64e85164b build(libs): let the system libraries compile with Emscripten
Emscripten targets wasm64 without x86 assembly, Linux-only headers or the
x87 long double. These changes add __EMSCRIPTEN__ paths beside the host
ones; native builds compile the same code as before.

- libc: long doubles in guest varargs and scanf go through
  GuestLongDouble, a plain copy where long double is the x87 format;
  APS5_EXPORT emits no assembler alias; the guest arena is one aligned
  allocation that zeroes pages when they are committed again; getifaddrs
  keeps its link-level entries on Linux; /proc lookups and the host
  stderr duplicate are left out.
- libkernel: file-backed mmap, EVFILT_VNODE watches, getcontext and
  setcontext throw; getdents replaces the raw getdents64 syscall;
  getdtablesize takes the resource limit alone.
- VideoOut leaves SDL, the display window and the HDR probe out,
  Sysmodule asks libkernel for unwind information and Net includes
  sys/time.h.
2026-10-30 10:50:57 +09:00
Adrià 2485cdefa3 Merge pull request #12538 from babyhuey/fix/utimes-efault
fix(libkernel): return EFAULT from the utimes family for an unreadable times array
2026-10-30 02:31:43 +01:00
Adrià 96613bba67 Merge pull request #12060 from Ragbie/fix/windows-directory-flock
fix(libkernel): lock directories with flock on Windows as FreeBSD does
2026-10-30 01:04:03 +01:00
Adrià 788e5531a1 Merge pull request #12163 from slopgobblercobbler/fix/libkernel-windows-descriptor-socket-classification
fix(libkernel): classify guest sockets on Windows and align errno parity
2026-10-29 23:46:12 +01:00
Hedi Trigui 3dfc973fb8 fix(libc): address review feedback on vdprintf guest write path, short writes, ABI and test coverage 2026-10-29 17:30:21 +01:00
ntamas94andClaude Opus 5.5 da7581eec4 fix(libkernel): report a 64 KiB st_blksize for directories
A PS4 Pro (firmware 10.71) reports st_blksize 0x10000 from stat and fstat
for /app0, its subdirectories and the system library directory. Titles
size one getdents buffer from it: CUSA18659's CryPak reads st_blksize +
264 bytes once, so the 512 reported here cut its shader directory listing
short. Directories, app0.zar ones included, now report 0x10000; /data
directories (0x8000 on the console) and files are recorded as debt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:17:34 +01:00
xXPBSXxandClaude Sonnet 5.5 14dbd31937 fix(libkernel): call the kqueue descriptor check by its new name after the merge of main
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-29 12:43:53 +01:00