'readLink' fails on non-symlink file #9872
Labels
bug
Observed behavior contradicts documented or intended behavior
standard library
This issue involves writing Zig code for the standard library.
Milestone
Summary
When running the std.os.readLink function on a non-link path on Linux, an unreachable place of code is reached.
Setup
Reproduction
result:
Analysis
The system call likely returns EINVAL if a non-link file is link resolved. The code at readlinkatZ doesn't expect this value as the switch case in unreachable.
Possible solution
Add a 'NotALink' error and return it when receiving EINVAL from the system.
The text was updated successfully, but these errors were encountered: