Skip to content

Conversation

@penberg
Copy link
Collaborator

@penberg penberg commented Dec 31, 2025

Implement the linkat syscall and link() filesystem operation to enable hard links in AgentFS. This fixes the cargo incremental compilation warning about hard linking files failing.

Implement the linkat syscall and link() filesystem operation to enable
hard links in AgentFS. This fixes the cargo incremental compilation
warning about hard linking files failing.

Changes:
- Add link() method to FileSystem trait with implementations for
  AgentFS (creates new dentry pointing to same inode), HostFS
  (delegates to kernel), and OverlayFS (with copy-up semantics)
- Add link() to VFS trait and SqliteVfs implementation
- Add handle_linkat syscall handler in ptrace sandbox with path
  translation for both virtual VFS and bind mounts
- Implement link() in FUSE filesystem
- Add comprehensive syscall test (test-link.c) covering hard link
  creation, inode sharing, nlink count, data sharing, and error cases
@penberg penberg merged commit f1b0f2c into main Jan 3, 2026
33 checks passed
@penberg penberg deleted the hardlink branch January 3, 2026 13:20
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.

2 participants