Commit Graph
593 Commits
Author SHA1 Message Date
orezraeyandClaude Opus 5.5 36814cbbe0 Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 14:59:00 -03:00
Dean eb14e8daf5 Merge pull request #16082 from oneandonlydean/fix/sandbox-cert-list-no-throw
fix(libkernel): never throw from the sandbox certificate list
2026-11-06 07:40:08 +13:00
Dean Galvin 7361a14382 fix(libkernel): remove the temporary certificate file after a failed rename
The temporary file is made read-only before the rename. When the rename
fails, Windows refuses to remove a read-only file, so the temporary copy
stayed in the cache directory. Give the owner write permission back
before removing it. The failure test now clears its cache directory,
including read-only files, before and after it runs, so it can run
again in the same directory.
2026-11-06 06:37:09 +13:00
Opensource55 dfc217b316 fix(libc): reopen a standard stream onto a directory on Windows
A guest that reopens `stdin`, `stdout` or `stderr` onto a directory in a read mode threw instead of
returning the stream, while the console answers that a directory opens in a read mode and the
debt entry already recorded the throw as the Windows difference.

The standard stream now goes through the same descriptor move a regular file uses: the directory
descriptor is opened, moved onto the standard descriptor, and libkernel's directory entry follows
it, so `fstat` of the guest descriptor reports a directory and the first read answers `EISDIR` with
the error indicator set, like every other directory stream. A failed open restores the previous
standard target.

`guest_freopen_host_standard` reopens `stdout` onto a directory, asserts `S_IFDIR` on the guest
descriptor, asserts the first read answers `EISDIR`, then reopens the same stream on a file path
and writes through it.
2026-11-06 01:09:06 +08:00
Dean Galvin bb225c2257 fix(libkernel): never throw from the sandbox certificate list
Writing and reading the cached CA_LIST.cer used the throwing filesystem
and stream calls. Tests that share the cache directory raced on the
rename over the cached file, and on Windows the resulting
filesystem_error cannot be delivered through libkernel frames, so the
test process died. Use the error_code overloads, read in chunks that
set the stream error state, treat a lost rename race as success when the
cached file already holds the bundle, and answer an unavailable list
with no file instead of caching the failure.

The new test blocks the cache directory and the cached file in turn and
expects the open to fail with ENOENT, then to succeed once unblocked.
2026-11-06 04:30:33 +13:00
orezraeyandClaude Opus 5.5 2e5675adfa Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 09:23:22 -03:00
Dean 2ad4212034 Merge pull request #12139 from dantdmdarealguy/fix/getdents-removed-entries-windows
fix(libkernel): leave out directory entries removed while getdents lists them on Windows
2026-11-06 00:04:44 +13:00
Dean 26e8ed784a Merge pull request #12915 from Kikoarl/fix/libkernel-fstatat-bounds
fix(libkernel): validate guest FileStat destination in fstatat when follow is false
2026-11-05 21:51:07 +13:00
Dean 051d531d1b Merge pull request #14493 from AlexWhitehouse/fix/libkernel-windows-sparse-truncate
fix(libkernel): leave Windows truncate extensions as sparse holes
2026-11-05 17:27:50 +13:00
Dean 0db469c769 Merge pull request #9019 from yabanana/feat/kernel-sys-pwrite
feat(libkernel_sys): implement pwrite through the shared POSIX provider
2026-11-05 06:34:17 +13:00
Dean 4f41f4c375 Merge pull request #15210 from Danigamer05/feat/libc-sce-v2-filesystem-calls-20261102
feat(libc): export the std::__sce_v2 filesystem calls
2026-11-03 21:12:18 +13:00
Dean 91ca312437 Merge pull request #9242 from DavidSamir/feat/libkernel-sys-tcgetsid
feat(libkernel): implement tcgetsid
2026-11-03 21:09:31 +13:00
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
orezraeyandClaude Opus 5.5 125a0d5c55 Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 19:45:25 -03:00
Dean Galvin 843f35fa2a Merge commit '88bb16c20e757658078b3efce912c96b1b03502a' into HEAD
# Conflicts:
#	core/libs/prx/libkernel_sys/Export.Discovery.cpp
#	core/libs/prx/libkernel_sys/include/Api.hpp
2026-11-03 11:45:11 +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
orezraeyandClaude Opus 5.5 cf7da83495 Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 18:17:19 -03:00
Danigamer05andClaude Opus 5.5 0f12fc9b7e feat(libc): export the std::__sce_v2 filesystem calls
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 21:36:17 +01: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 Galvin 1e6b6947b3 Merge main 096c45570f into #9019 (79b02b3bdb) 2026-11-03 09:03:03 +13: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
Alex WhitehouseandClaude Opus 5.5 ac08050a7d fix(libkernel): extend without sparse marking when the volume query fails
Discovery failures now fall back to the plain end-of-file extension.
Sparse-marking and EOF failures still map to errors.
An IAT-patched regression covers the three truncate paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 16:03:12 +00:00
Alex Whitehouse b0035b21a2 fix(libkernel): leave Windows truncate extensions as sparse holes
Follow FreeBSD 11.4 ffs_truncate by leaving the extended range as a hole. Use FSCTL_SET_SPARSE on sparse-capable Windows volumes before setting EOF.
2026-11-01 14:51:02 +00: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
Dean Galvin 019e993acc Merge commit 'a644edf30c501a612d06f17d05ef1b7051350cef' into HEAD
# Conflicts:
#	core/libs/prx/libkernel/include/Api.hpp
2026-11-01 23:13:39 +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