fchown, fstat and ioctl on a kqueue descriptor answer like a null device, FreeBSD answers EINVAL, S_IFIFO and ENOTTY #10015
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-23T04:08:35Z.
A kqueue descriptor is backed by a placeholder host handle (
NULon Windows,/dev/nullon POSIX hosts), and three calls answer it as that character device instead of as a kqueue:fchown(kq, 0, 0)returns 0 where FreeBSD 11.4 returns EINVAL (invfo_chown, sys/kern/kern_descrip.c:4076);fstat(kq)reports the placeholder's type where FreeBSD'skqueue_stat(sys/kern/kern_event.c:1928) zeroes the struct and setsst_mode = S_IFIFO; andioctl(kq, <request>)reaches the "unsupported request" throw where FreeBSD'skqueue_ioctl(kern_event.c:1853) returns ENOTTY. Found by comparing the descriptor operations against the FreeBSD 11.4 source, not from a title.AI-assisted (Claude Code).