Commit Graph
474 Commits
Author SHA1 Message Date
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
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
Maz f6c24fc271 fix(libkernel): remove a Windows directory junction without emptying its target
rmdir followed the junction and reported ENOTEMPTY, and unlink treated it as a real directory, so a junction to a non-empty folder could not be removed.
2026-10-26 00:02:20 +04:00
GruzzberryandClaude Opus 5.5 720cf7e296 fix(libkernel): fail chflags through a dangling Windows symbolic link with ENOENT
std::filesystem::status does not follow a Windows symbolic link under
MinGW, so the lookup chflags makes saw a link whose target is missing as
an existing file and returned 0. A reparse point in the last component
is now looked up through the target with the guest stat, as FreeBSD 11.4's
namei follows it: a missing target gives ENOENT, and a trailing slash
after a link to a file gives ENOTDIR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:58:17 +01:00
Adrià 506991994d Merge pull request #9496 from Gruzzberry/fix/open-excl-symbolic-link
fix(libkernel): fail open with O_CREAT and O_EXCL on a Windows symbolic link
2026-10-25 18:35:57 +01:00
Adrià 2e1c72239b Merge pull request #9487 from Gruzzberry/fix/chmod-symbolic-link
fix(libkernel): follow a Windows symbolic link in chmod
2026-10-25 18:25:24 +01:00
Adrià Franch df0bfbee90 fix(libkernel): drop the duplicate sceKernelFsync declaration 2026-10-25 17:14:58 +01:00
David 60603545ff fix(libkernel): keep the writev sync guard out of std::optional
Destroying a std::optional is noexcept in libstdc++, so a failing sync in
the guard's destructor ended the process with std::terminate instead of
raising the sync error. The Windows writev and pwritev path now uses a
plain guard, which does nothing for -1. The debt line names the synced
write calls and leaves out the AIO writes.
2026-10-25 17:13:09 +01:00
David a81fcbfacd feat(libkernel): sync each write on a file whose O_FSYNC flag is set
FreeBSD's F_SETFL may change O_FSYNC (FCNTLFLAGS), and vn_write then
writes with IO_SYNC. The flag now lives in the status table, and the
write entry points sync a regular file after the write while it is set.
2026-10-25 17:13:01 +01:00
pushkarreddyy 4d4cb28eb0 feat(libkernel): return EFAULT for unreadable append iovec buffers on Windows 2026-10-25 21:39:38 +05:30
harisibrar1andClaude Opus 5.5 aebd8881d4 fix(libkernel): fail a write to a pipe without a reader with EPIPE on Windows
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 10:27:58 -04:00
Yunus Shaikh 20ae347f6a Merge main into fix/libkernel-lstat-relinked-prx
Main's #9618 has lstat fill a local FileStat and copy it out to the guest.
The merge keeps that and this branch's module lookup in the same call, so an
original .prx name still resolves to its relinked .guest.prx.
2026-10-25 03:56:39 -07:00
Adrià 35d22d88f9 Merge pull request #9618 from xXPBSXx/fix/output-structs-efault
fix(libkernel): fail the stat family with EFAULT when the output struct is not writable guest memory
2026-10-25 11:52:20 +01:00