fchdir on a kqueue descriptor fails with ENOTDIR on Windows, FreeBSD answers EINVAL #9993
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-23T03:22:57Z.
FreeBSD 11.4
sys_fchdirtakes the descriptor throughgetvnode(sys/kern/vfs_syscalls.c, thefp->f_vnode == NULL || fp->f_ops == &badfileopscheck at lines ~3871-3875), which fails a descriptor without a vnode, and a kqueue has none, withEINVAL.fchdir_nid_postfixasksDescriptorHasNoVnode_nid_no_patchand answersENOTDIRonly for descriptors that have a vnode; the kqueue's host placeholder is a character device (NULon Windows,/dev/nullon POSIX hosts), which the helper counts as a vnode. Probe on Windows 10:fchdir(kqueue())-> ENOTDIR (20), FreeBSD EINVAL (22);fchdir(pipe end)-> 22 already (since #9131).AI-assisted (Claude Code).