485 Commits
Author SHA1 Message Date
Adrià 2257ffde7b Merge pull request #9473 from cadenasynyster/fix/windows-directory-link-rmdir-unlink
fix(libkernel): rmdir and unlink on a Windows directory link
2026-10-29 09:31:36 +01:00
Adrià c70c75ad13 Merge pull request #9284 from DavidSamir/feat/libkernel-sys-ksem-unnamed
feat(libkernel): implement the unnamed ksem semaphores
2026-10-29 08:48:19 +01:00
DeveshB-1 1a47f9f0ee fix(libkernel): return EFAULT from ioctl FIONREAD for an unwritable argument 2026-10-29 09:15:45 +05:30
Dean 9412e47af6 Merge pull request #12579 from babyhuey/fix/fionbio-efault
fix(libkernel): return EFAULT from ioctl FIONBIO for an unreadable argument
2026-10-29 12:15:13 +13:00
Dean d775fc5958 Merge pull request #11403 from MarcZX10/marc/fix-libkernel-shm-anon-windows
fix(libkernel): recognize Windows anonymous shared memory descriptors
2026-10-29 11:49:22 +13:00
Dean 319621ba2e Merge pull request #12339 from medazizktata/fix/windows-exec-shared-mapping
fix(libkernel): map shared memory and files executable on Windows
2026-10-29 07:28:16 +13:00
babyhuey b4ae3afc61 fix(libkernel): return EFAULT from ioctl FIONBIO for an unreadable argument
ioctl(FIONBIO) read its int argument directly after the existing null
check, so a non-null pointer into unmapped memory crashed the host.
FIONBIO is an _IOW request, which FreeBSD copies in and fails with
EFAULT; the argument is now copied in with GuestCopyIn_nid_no_patch
before the status change.
2026-10-28 14:19:31 -04:00
MarcZX10 436769c634 fix(libkernel): recognize Windows anonymous shared memory descriptors 2026-10-28 13:04:38 +00:00
cadenasynysterandClaude Sonnet 5.5 b28edaf954 fix(libkernel): rmdir and unlink on a Windows directory symbolic link
On Windows, std::filesystem::symlink_status and is_symlink report a directory symbolic link as a plain directory, so rmdir removed the link instead of failing with ENOTDIR (20) and unlink failed with EPERM (1) instead of removing it, unlike FreeBSD. Detect the symlink reparse tag with FindFirstFileW: rmdir returns ENOTDIR, unlink removes the link with RemoveDirectoryW. Junctions and volume mounts keep their previous behaviour. Enable the directory-link and dangling-link blocks of guest_filesystem on Windows (created with CreateSymbolicLinkW).

AI-assisted: yes

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-28 13:41:23 +01:00
David fd6513d6ff refactor(libkernel): move the unnamed ksem calls into libkernel
The PS5 3.20 export lists have ksem_* in libkernel as well as
libkernel_sys, and on Windows a libkernel import never reaches
libkernel_sys, so titles importing them from libkernel did not find
them. Following pipe1os's review on #9284, also: ENOSPC from
ksem_init when no descriptor is left, the SEM_MAX limit of 30 with
ENOSPC, and dup/dup2 from a ksem id throwing as for a kqueue.
2026-10-28 12:57:04 +01:00
Dean d937efc9ca Merge pull request #12283 from B-Howell/claude/fix-issue-12079-rmdir-link-classify
fix(libkernel): classify the rmdir path with lstat so links give ENOTDIR on Windows
2026-10-29 00:30:56 +13:00
Mohamed Aziz Ktata dbd826bc88 fix(libkernel): map shared memory and files executable on Windows
A guest mmap with PROT_EXEC and MAP_SHARED of a shared-memory object or a regular file threw on Windows. The section is now created from a handle reopened with GENERIC_EXECUTE, as PAGE_EXECUTE_READ or PAGE_EXECUTE_READWRITE, the owner ACE of named objects grants execute with read, and a writable shared mapping of a read-only descriptor fails with EACCES, as FreeBSD 11.4 shm_mmap and vn_mmap do.

Fixes #12337
2026-10-28 11:14:08 +01:00
Dean 7eac0fe4cb Merge pull request #12075 from JJenkx/windows/kernel-truncate-loop
fix(libkernel): report ELOOP from truncate on a looping Windows link
2026-10-28 22:46:08 +13:00
AdriàandClaude Sonnet 5.5 149ec09adf fix(libkernel): give the descriptor checks C linkage so libkernel_sys can import them
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 08:43:15 +01:00
AdriàandClaude Sonnet 5.5 f87b6289ac fix(libkernel): export the kqueue descriptor check to libkernel_sys
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 08:43:15 +01:00
B-HowellandClaude Opus 5.5 fe7a71c1ea fix(libkernel): classify the rmdir path with lstat so links give ENOTDIR on Windows
sceKernelRmdir decided whether the last component was a symbolic link with
std::filesystem::is_symlink, which follows the link with WinLibs libstdc++ on
Windows. A dangling or self-referencing file link then looked missing on
Windows 10 (ENOENT instead of ENOTDIR), and a directory link to an empty
directory looked like that directory, so rmdir removed the link and
returned 0. The last component is now classified with FillLinkStat, the
same lstat path lstat_nid_postfix uses, matching FreeBSD 11 kern_rmdirat,
which returns ENOTDIR for any non-directory vnode found without following
the last link.

Fixes #12079

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:10:08 -04:00
Dean ba8845d2e7 Merge pull request #9442 from Gruzzberry/feat/lchflags
feat(libkernel_sys): implement lchflags
2026-10-28 13:00:19 +13:00
JJenkxandClaude Opus 5.5 708808bd35 fix(libkernel): report ELOOP from truncate on a looping Windows link
sceKernelTruncate and truncate checked for a symbolic link loop only
after the native truncate failed, but on Windows std::filesystem::status
already reports a self-referencing link as missing, so the call returned
ENOENT before reaching that check. The loop check now runs before the
not-found result too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:06:29 -04:00
Adrià 62b3ba2522 Merge pull request #11125 from MarcZX10/marc/fix-equeue-close-during-measure
fix(libkernel): wait for an in-flight file measurement before closing a watched descriptor
2026-10-27 13:30:54 +01:00
Adrià 12686b52de Merge pull request #11060 from pushkarreddyy/fix/libkernel-writev-append-efault
fix(libkernel): return EFAULT for unreadable append iovec buffers on Windows
2026-10-27 08:56:20 +01:00
Adrià 22782795a9 Merge pull request #10853 from krishalivaibhav/fix/macos-open-create-directory
fix(libkernel): refuse O_CREAT on an existing directory with EISDIR on macOS
2026-10-27 06:18:28 +01:00
MarcZX10 ea4eaeae42 fix(libkernel): remove a watched descriptor's events before dup2 takes its positioned lock on Windows
dup2 called EqueueDescriptorClosed(to) while holding the positioned-transfer lock of the descriptor, and the in-flight measurement it waits for needs that lock for its sceKernelLseek, so dup2 onto a watched descriptor deadlocked. The events are removed first, before the lock is taken.
2026-10-27 04:46:00 +00:00
Adrià b986c11a34 Merge pull request #10543 from maximilianfv/fix/libkernel-macos-append-positioned-writes
fix(libkernel): append positioned writes on an O_APPEND descriptor on macOS
2026-10-27 04:52:27 +01:00
Dean Galvin f733f7dc43 Merge branch 'main' into feat/lchflags 2026-10-27 11:58:22 +13:00
Dean f423468b43 Merge pull request #11339 from harisibrar1/fix/lseek-pipe-negative-espipe
fix(libkernel): fail lseek on a pipe with ESPIPE for a negative offset on Windows
2026-10-27 11:08:02 +13:00
Dean d9c7bb5ffe Merge pull request #11242 from parl0v/fix/epoll-kernel-sockets
fix(libSceNet): register libkernel sockets with sceNetEpollControl
2026-10-27 11:05:08 +13:00
Dean 0bad0fc46a Merge pull request #11218 from Gruzzberry/fix/lutimes-enotdir
fix(libkernel): lutimes reports ENOTDIR for a path through a file
2026-10-27 11:03:44 +13:00
Dean 5dd28e5682 Merge pull request #11135 from orezraey/fix/libkernel-dupfd-cloexec-measured-ps5
fix(libkernel): fail F_DUPFD_CLOEXEC and make F_DUP2FD_CLOEXEC ignore its target as measured on a PS5
2026-10-27 11:01:17 +13:00
Dean 26bbcd1b48 Merge pull request #11288 from Gruzzberry/fix/fchmodat-follow-links
fix(libkernel_sys): fchmodat follows a symbolic link like chmod
2026-10-27 10:40:54 +13:00
Dean 29b9c07b6b Merge pull request #11040 from harisibrar1/fix/pipe-write-epipe-windows
fix(libkernel): fail a write to a pipe without a reader with EPIPE on Windows
2026-10-27 10:36:08 +13:00
Dean fd75cc804d Merge pull request #9095 from mazen320/fix/unlinkat-windows-junction
fix(libkernel): treat Windows junctions in unlinkat like unlink and rmdir
2026-10-27 10:29:02 +13:00
Adrià Franch 8676daa0fc merge: sync archive directories with main 2026-10-26 12:02:23 +01:00
Adrià FranchandClaude Sonnet 5.5 654eadd7f5 merge: sync archive directories with main
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 10:50:37 +01:00
SimoneandClaude Opus 5.5 88e86a7de1 fix(libkernel): check vector I/O lengths and descriptors before offsets
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 10:45:00 +01:00
Dean 27c2794a66 Merge pull request #8726 from ArjenS-LA/fix/windows-directory-link-types
fix(libkernel): classify Windows directory links by app0 scope
2026-10-26 20:36:06 +13:00
Dean ae3ec59aba Merge pull request #10734 from imellag/refactor/libkernel-rename-dead-dot-checks
refactor(libkernel): drop the unreachable dot checks after sceKernelRename's return
2026-10-26 19:58:55 +13:00
harisibrar1andClaude Opus 5.5 60b5b9b7ab fix(libkernel): fail lseek on a pipe with ESPIPE for a negative offset on Windows
NativeLseek seeked first and only checked for a pipe when the host seek
succeeded, so a negative offset reached the guest as EINVAL from
_lseeki64. FreeBSD 11.4's kern_lseek returns ESPIPE for any seek on a
descriptor without DFLAG_SEEKABLE, so the pipe check now comes first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 00:19:36 -04:00
orezraeyandClaude Opus 5.5 85a1bf2b31 Merge main into fix/libkernel-dupfd-cloexec-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 23:27:02 -03:00
Adrià 3b252b44fe Merge pull request #9561 from DavidSamir/feat/libkernel-fcntl-osync
feat(libkernel): sync each write on a file whose O_FSYNC flag is set
2026-10-26 02:26:06 +01:00
qpavyros 9b2dd8dce9 merge: sync archive follow-up with main 2026-10-26 01:53:02 +02:00
GruzzberryandClaude Sonnet 5.5 7322a3b9f8 fix(libkernel_sys): fchmodat follows a symbolic link like chmod
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 23:50:43 +00:00
qpavyros bebe28593d fix(libkernel): preserve native directory metadata 2026-10-26 01:33:46 +02:00
Adrià efd368fec6 Merge pull request #9469 from Gruzzberry/fix/chflags-dangling-link
fix(libkernel): fail chflags through a dangling Windows symbolic link with ENOENT
2026-10-26 00:13:50 +01:00
qpavyros 6105be4431 merge: sync archive directories with main 2026-10-26 01:10:12 +02:00
Josip Parlov 3cbd5a4be3 fix(libkernel): retire epoll registrations of a socket closed with sceKernelClose 2026-10-25 23:35:48 +01:00
GruzzberryandClaude Opus 5.5 33299ee554 feat(libkernel_sys): implement lchflags
lchflags is chflags without following a symbolic link in the last path
component, as FreeBSD 11.4's sys_lchflags calls kern_chflagsat with
AT_SYMLINK_NOFOLLOW. chflags now goes through a shared helper that takes
the follow choice; a link in the last component is accepted as the
target when not following, and the flag checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:14:40 +00:00
GruzzberryandClaude Sonnet 5.5 4dc65b0c6f fix(libkernel): lutimes reports ENOTDIR for a path through a file
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 21:34:25 +00:00
orezraeyandClaude Opus 5.5 0868498fc2 fix(libkernel): make F_DUP2FD_CLOEXEC duplicate without the target as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:04:25 -03:00
orezraey ea98a6e5f1 fix(libkernel): fail F_DUPFD_CLOEXEC with EOPNOTSUPP as measured on a PS5 2026-10-25 18:04:25 -03:00
Adrià 065d5dba6a Merge pull request #9502 from GitamarT045T3R/fix/libkernel-fchmod-pipe
fix(libkernel): fail fchmod on a pipe with EINVAL like FreeBSD
2026-10-25 21:03:23 +01:00