Commit Graph
106 Commits
Author SHA1 Message Date
Dean 118d39300d Merge pull request #16476 from slopgobblercobbler/slopgobblercobbler/worker84-spirv-quad-shuffle
feat(libkernel): implement pipe2 with non-blocking O_NONBLOCK and buffer capacity
2026-11-10 22:08:14 +13:00
Daniele Giovane 38c80b8337 chore(libkernel_sys): reconcile path operations with current main 2026-11-09 10:59:52 +01:00
slopgobblercobbler 08f80b44d6 feat(libkernel): implement pipe2 with non-blocking O_NONBLOCK and buffer capacity 2026-11-08 05:25:01 +01:00
Daniele Giovane e0de57dc21 fix(libkernel_sys): update path tests for parent-target symlinks 2026-11-04 13:39:34 +01:00
Dean Galvin 1e6b6947b3 Merge main 096c45570f into #9019 (79b02b3bdb) 2026-11-03 09:03:03 +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
Daniele Giovane d0ac6078bf chore: reconcile kernel contribution with current main 2026-10-28 10:49:14 +01:00
Daniele Giovane d2f98f3910 chore: reconcile kernel contribution with current main 2026-10-28 10:49:14 +01: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 <noreply@anthropic.com>
2026-10-28 08:43:15 +01: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 d086e56905 Merge branch 'main' into feat/kernel-sys-path-operations 2026-10-27 11:58:22 +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
Daniele Giovane 82fafdc208 fix(libkernel): retain pwrite guards and split named-memory checks 2026-10-26 17:05:36 +01:00
Evrim Cicek d1ab9af5dc fix(libc): hold the positioned-transfer lock until fclose and freopen close the descriptor 2026-10-26 16:36:46 +03:00
Evrim Cicek 96bb078a0c fix(libc): drop the kernel state of a descriptor that fclose or freopen closes 2026-10-26 16:36:45 +03:00
Adrià Franch 8676daa0fc merge: sync archive directories with main 2026-10-26 12:02:23 +01:00
Daniele Giovane c24c61778c test(libkernel): inspect symlink reparse data on Windows 2026-10-26 11:30:34 +01:00
Adrià FranchandClaude Sonnet 5.5 654eadd7f5 merge: sync archive directories with main
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
2026-10-26 10:45:00 +01:00
Daniele Giovane c1082f49d3 fix(libkernel): reconcile pwrite metadata with current main 2026-10-26 10:17:49 +01:00
GruzzberryandClaude Sonnet 5.5 7322a3b9f8 fix(libkernel_sys): fchmodat follows a symbolic link like chmod
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 23:50:43 +00: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
Daniele Giovane 2dd3d699f2 Merge main and preserve pipe and fixed-size descriptor state 2026-10-24 22:38:04 +02:00
Daniele Giovane 64f6416f76 Merge main and retain path-operation providers 2026-10-24 22:38:04 +02:00
Kang, Harry Zixuan c5447f8aaf fix(libkernel): bound scalar writes to anonymous shared memory 2026-10-24 22:37:11 +02:00
qpavyros 0a64d23bdf feat(libkernel): enumerate archived app directories
Squashed onto current main, resolving the fchflags/fstatfs conflict with the kqueue guards.
2026-10-24 20:18:05 +02:00
Adrià 6b496aa1d1 Merge pull request #7299 from qpavyros/codex/windows-named-shm
feat(libkernel): support named shared memory on Windows
2026-10-24 19:42:16 +02:00
954a8e1a9d fix(libkernel): append positioned writes on an O_APPEND descriptor on macOS
macOS pwrite and pwritev write at the given offset even when the
descriptor was opened with O_APPEND. FreeBSD's vn_write appends to an
O_APPEND regular file whatever the offset and leaves the file offset
unchanged, and Linux pwrite appends too. On macOS, sceKernelPwrite,
pwrite, sceKernelPwritev, pwritev and the AIO write commands now append
such writes with writev and restore the file offset, as #8359 does on
Windows.

Co-authored-by: Himansh Raj <67262056+iamthehimansh@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:34:28 -03:00
Dean Galvin 6747c5b996 Merge main into fix/fcntl-getfl-pipe-rdwr 2026-10-24 02:10:48 +13:00
Daniele Giovane d0dbe8be09 Merge main and address review for PR 9161 2026-10-23 12:45:54 +02:00
Daniele Giovane 096195ddcd Merge main and address review for PR 9019 2026-10-23 12:45:54 +02:00
Dean a75292c7b3 Merge pull request #8687 from cadenasynyster/fix/win-loop-errors
fix(libkernel): report ELOOP from unlink, mkdir, rmdir, truncate on Windows
2026-10-23 21:08:52 +13:00
Adrià FranchandClaude 093a5ba195 fix(libkernel_sys): reach the fchdir vnode check through a _nid_no_patch export
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-22 20:15:39 +02:00
xXPBSXxandClaude Sonnet 5.5 e56c6d2ba8 fix(libkernel_sys): keep ENOTDIR from fchdir on a character device
The EINVAL for a descriptor without a vnode now applies only to a pipe or socket. A character device is a vnode on FreeBSD, so getvnode succeeds and change_dir fails with ENOTDIR; File::IsCharacterDevice keeps that answer for the host character devices (a tty, NUL or /dev/null) and the guest random device. guest_kernel_sys pins it with /dev/random.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 20:15:26 +02:00
qpavyros f9cd3ba1ce chore: merge current main into named shared memory 2026-10-22 01:44:14 +03:00
Daniele Giovane 25aa916caf feat(libkernel_sys): implement statfs symlinkat and futimesat 2026-10-21 15:56:44 +02:00
Daniele Giovane aaad8e9b8a feat(libkernel_sys): implement pwrite through the shared POSIX provider 2026-10-21 11:52:44 +02:00
blu 04b1d6e5b5 Merge branch 'boykopovar:main' into pr/windows-reparse-non-link 2026-10-20 23:38:51 -07:00
cadenasynysterandClaude Sonnet 5.5 e3d249fb05 fix(libkernel): report ELOOP from unlink, mkdir, rmdir and truncate on Windows
A path through a self-referencing symbolic link returned ENOTDIR, EIO or EINVAL on Windows; FreeBSD returns ELOOP. The failure paths now use the loop check that sceKernelStat uses.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-20 23:02:35 +02:00
xXPBSXxandClaude Sonnet 5.5 eaadb2924b fix(libkernel): report the starting entry index in getdirentries basep on Windows
The Windows sceKernelGetdirentries stored 0 in *basep on every read, so a
guest looping on the cookie saw it stall (FreeBSD stores the directory
offset the read started at, kern_getdirentries: *basep = loff). Report the
index of the first entry of the read, the same unit lseek takes on these
descriptors, and run guest_directory_entries on Windows, where it was never
built.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 19:33:03 +02:00
Retr0 2d1fa5aea5 fix(libkernel): report O_RDWR from F_GETFL on both ends of a pipe
FreeBSD 11's kern_pipe opens both ends with FREAD | FWRITE, so F_GETFL
reports O_RDWR on each. The host pipe ends are one-way, so the access
mode came back as O_RDONLY and O_WRONLY. Descriptors made by pipe() are
now marked in the guest descriptor table, the mark follows dup, dup2 and
F_DUPFD, and F_GETFL reports O_RDWR for them.
2026-10-20 19:04:22 +03:00
bluandClaude Opus 5.5 0ecef87c4c fix(libkernel): answer Windows reparse points that are not links
lstat and readlink threw NotImplemented for every Windows reparse point
other than a symbolic link or a drive junction. A tag without the name
surrogate bit (cloud files, deduplication) does not stand for another path,
so lstat now answers as stat does and readlink returns EINVAL, as FreeBSD
does for a file that is not a link and as CPython's os.lstat and os.readlink
do (bpo-37834). A name surrogate that is neither a symbolic link nor a
junction (a mounted volume, a WSL link) is reported as the reparse point
itself with the mode of its attributes, and readlink returns EINVAL.

The tests set reparse tags with FSCTL_SET_REPARSE_POINT, one without the
name surrogate bit and one with it. A compact /exe (WOF) file cannot serve
as the fixture: on Windows 11 24H2 the WOF filter hides the reparse point
from GetFileAttributesW and FileAttributeTagInfo alike. Windows refuses
every open of an unhandled tag without FILE_FLAG_OPEN_REPARSE_POINT, so the
test requires lstat to agree with stat rather than to succeed.

mashingaan's boykopovar/AnyPS5#6447 returned EINVAL for other reparse
points without the tag check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-20 08:21:33 -07:00
Adrià 5f7aa5570c Merge pull request #7563 from babyhuey/feat/libkernel_sys-fstatat
feat(libkernel_sys): implement fstatat
2026-10-20 16:08:26 +02:00
Dean 564c75b289 Merge pull request #7956 from Lindamea1/fix/libkernel-ioctl-malformed-enotty
fix(libkernel): fail a malformed ioctl request with ENOTTY
2026-10-20 17:49:59 +13:00
xXPBSXxandClaude Sonnet 5.5 7535eb45fc fix(libSceLibcInternal): start fdopendir at the descriptor position and set FD_CLOEXEC
fdopendir listed the directory from its first entry whatever position the
descriptor had, and left FD_CLOEXEC unchanged. FreeBSD 11.4 fdopendir sets
FD_CLOEXEC on the descriptor and preserves the initial seek position (lib/libc/gen/opendir.c).
The Windows directory handle now skips the entries the descriptor already
consumed, the Linux handle duplicates the descriptor, and the test requires both.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 03:11:14 +02:00
Dean 0b6486704b Merge pull request #7915 from root-over/fix/libkernel-open-flags-before-path-v2
fix(libkernel): check open flags before the path in open, _open and openat
2026-10-20 05:52:06 +13:00
Hussein Kadhim baa6d4aeee fix(libkernel): fail a malformed ioctl request with ENOTTY before the descriptor is looked at
FreeBSD's sys_ioctl rejects a request with no direction bit, an output request with no length, or a void request whose length is not an int before it reads the argument or resolves the descriptor. ioctl threw on such a request for a file, pipe or directory, failed with EBADF for a closed descriptor and with EFAULT for a socket given no argument.

(cherry picked from commit 501518f321ac5d0b45ce1090af39c680927edf49)
(cherry picked from commit 3eb7edd9cf)
2026-10-19 16:25:42 +01:00
Giuseppe Magliano ff688b2146 fix(libkernel): check open flags before the path in open, _open and openat
FreeBSD 11.4 rejects access mode 3 in kern_openat and
O_CREAT|O_EXCL|O_DIRECTORY in vn_open_cred before namei reads the path
or resolves the directory descriptor. open, _open and openat checked a
NULL or empty path first and returned EFAULT or ENOENT for those flags.
InvalidOpenFlags moves to FileFlags.hpp and runs first in all three.
2026-10-19 15:34:43 +02:00
qpavyros 617696214f feat(libkernel): support named shared memory on Windows 2026-10-19 15:28:35 +02:00
MarcZX100 41483e7a21 fix(libkernel): return ELOOP when stat follows a symlink loop 2026-10-19 14:44:32 +02:00