Skip to content

feat: add procfs directory listing for ls /proc#168

Merged
ryanbreen merged 1 commit intomainfrom
feat/procfs-directory-listing
Feb 7, 2026
Merged

feat: add procfs directory listing for ls /proc#168
ryanbreen merged 1 commit intomainfrom
feat/procfs-directory-listing

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Add ProcfsDirectory fd type following the DevfsDirectory pattern
  • Add handle_procfs_getdents64() handler that generates dirent64 entries for /proc, /proc/trace, and /proc/[pid] directories
  • Modify handle_procfs_open() to detect directory paths and return ProcfsDirectory fds
  • Wire into sys_getdents64() and sys_fstat()
  • Add ProcfsDirectory match arms across all 7 files with exhaustive FdKind matches

Test plan

  • ARM64 kernel builds cleanly (zero warnings)
  • x86_64 kernel builds cleanly (zero warnings)
  • ls /proc lists all entries including PID directories
  • ls /proc/trace lists tracing sub-entries
  • cat /proc/slabinfo still works (no regression)

🤖 Generated with Claude Code

Add ProcfsDirectory fd type and handle_procfs_getdents64() handler,
following the same pattern as DevfsDirectory. This enables `ls /proc`
to list all procfs entries including dynamic PID directories.

The handler supports three directory contexts:
- /proc: lists static entries (uptime, meminfo, stat, etc.) plus
  dynamic PID directories from the process manager
- /proc/trace: lists tracing sub-entries
- /proc/[pid]: lists per-process files (status)

Also adds ProcfsDirectory match arms in all exhaustive FdKind matches
across both x86_64 and ARM64 syscall handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit 2371db1 into main Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant