]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: add ioctl/mmap callbacks to fs_node_t, decouple ioctl dispatch
authorTulio A M Mendes <[email protected]>
Thu, 12 Feb 2026 07:11:59 +0000 (04:11 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 02:44:55 +0000 (23:44 -0300)
commit15056bac8a755ee88ed16a107f5aae85aaf1c173
treee8ce0dd91c53bf97e6e2bb65191766a09fea4fc9
parentda410fae2dd9ec058a02e2b1061fe03ae48b1ae9
refactor: add ioctl/mmap callbacks to fs_node_t, decouple ioctl dispatch

Added ioctl and mmap function pointers to fs_node_t for generic
device dispatch. Refactored syscall_ioctl_impl to call node->ioctl
instead of hardcoding TTY/PTY dispatch by inode number.

- tty.c: added tty_devfs_ioctl wrapper, set on console/tty nodes
- pty.c: added pty_slave_ioctl_fn wrapper, set on all slave nodes
- syscall.c: ioctl now dispatches generically through node callback

This prepares the VFS for /dev/fb0 and other devices that need
ioctl and mmap support.
include/fs.h
src/kernel/pty.c
src/kernel/syscall.c
src/kernel/tty.c