read, write, lseek, fsync and flock on a kqueue descriptor answer like a null device, FreeBSD refuses them #10013

Closed
opened 2026-10-23 04:03:25 +00:00 by xXPBSXx · 0 comments
xXPBSXx commented 2026-10-23 04:03:25 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-23T04:03:25Z.


FreeBSD 11.4 kqueueops (sys/kern/kern_event.c:122): fo_read/fo_write are invfo_rdwr (sys/kern/kern_descrip.c:4029, returns EOPNOTSUPP); a kqueue is not DFLAG_SEEKABLE (lseek ESPIPE); kern_fsync (vfs_syscalls.c:3098) takes the descriptor through getvnode (EINVAL); sys_flock (kern_descrip.c:2889) returns EOPNOTSUPP for a non-vnode. The host placeholder behind a kqueue descriptor is a null device (NUL on Windows), so on Windows 10: read(kq) -> 0, write(kq) -> EBADF, lseek(kq,0,0) -> 0, fsync(kq) -> EBADF, flock(kq) -> 0 (probe ProbeH16).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5991654523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/10013). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-23T04:03:25Z. --- FreeBSD 11.4 `kqueueops` (sys/kern/kern_event.c:122): `fo_read`/`fo_write` are `invfo_rdwr` (sys/kern/kern_descrip.c:4029, returns `EOPNOTSUPP`); a kqueue is not `DFLAG_SEEKABLE` (lseek `ESPIPE`); `kern_fsync` (vfs_syscalls.c:3098) takes the descriptor through `getvnode` (`EINVAL`); `sys_flock` (kern_descrip.c:2889) returns `EOPNOTSUPP` for a non-vnode. The host placeholder behind a kqueue descriptor is a null device (`NUL` on Windows), so on Windows 10: `read(kq)` -> 0, `write(kq)` -> EBADF, `lseek(kq,0,0)` -> 0, `fsync(kq)` -> EBADF, `flock(kq)` -> 0 (probe ProbeH16). AI-assisted (Claude Code).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#10013
No description provided.