Parent: #137
Goal
Convert native status codes and thread-local diagnostics into structured Results.
Scope
- Define stable variants for broad C error categories
- Capture the diagnostic message at the failing call
- Implement Display and Error
Non-goals
- One error variant per function
- Panicking on user input
- Exposing thread-local pointers
Acceptance criteria
- Public safe methods return Result for recoverable failures.
- Messages survive subsequent native calls.
- Unknown future codes remain representable.
Verification
Add tests for invalid handles through sys, invalid maps, invalid directions, buffers, snapshots, and unknown codes.
Parent: #137
Goal
Convert native status codes and thread-local diagnostics into structured Results.
Scope
Non-goals
Acceptance criteria
Verification
Add tests for invalid handles through sys, invalid maps, invalid directions, buffers, snapshots, and unknown codes.