]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: add VFS poll callback to fs_node_t, eliminate abstraction leaks from syscall.c
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 18:37:02 +0000 (15:37 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 18:37:02 +0000 (15:37 -0300)
commita7665fd7ea7bf012be0b4d264ecb86d3317083a8
tree4f03a9b23f3484f6e5221d9d287b054b61bfc250
parent609f46545655bd0e8fb2e37751fe90153579e18a
refactor: add VFS poll callback to fs_node_t, eliminate abstraction leaks from syscall.c

- Add int (*poll)(struct fs_node*, int events) to fs_node_t in fs.h
- Define VFS_POLL_IN/OUT/ERR/HUP constants in fs.h (shared)
- Implement poll callbacks: pipe_poll, tty_devfs_poll, pty_master/slave_poll_fn,
  dev_null_poll, dev_always_ready_poll, kbd_dev_poll
- Wire poll into all device nodes: /dev/null, /dev/zero, /dev/random, /dev/urandom,
  /dev/tty, /dev/console, /dev/ptmx, /dev/pts/N, /dev/kbd, pipe nodes
- Refactor poll_wait_kfds: dispatch through node->poll instead of hardcoded
  pipe name prefix, tty inode==3, pty_is_master/slave_ino checks
- Refactor non-blocking read/write: use node->poll instead of pipe name
  checks and tty/pty inode checks
- syscall.c no longer references tty_can_read/write, pty_*_can_read/write_idx,
  pty_is_master_ino, pty_ino_to_idx for poll/nonblock purposes
include/fs.h
src/drivers/keyboard.c
src/kernel/devfs.c
src/kernel/pty.c
src/kernel/syscall.c
src/kernel/tty.c