-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std.posix: Added error message 'ProcessNotFound' for reading and writing in a Linux process #21430
base: master
Are you sure you want to change the base?
Conversation
process. This error occurs if the process to be read from or written to no longer exists. Fixes ziglang#19875
I can't complete this PR due to the complexity of the dependencies. Since I can't test on MacOS or Windows and the error message only says "test-fmt transitive error", I don't know how to fix this. |
It means you have code formatting violations; run |
lib/std/posix.zig
Outdated
@@ -798,6 +798,10 @@ pub const ReadError = error{ | |||
/// In WASI, this error occurs when the file descriptor does | |||
/// not hold the required rights to read from it. | |||
AccessDenied, | |||
|
|||
// This error occurs in Linux if the process to be read from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be doc comments (///
instead of //
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handles ENOENT
aka errno 2 aka error.FileNotFound
, the linked issue is about ESRCH
(errno 3).
Because Linux returns the ENOENT error for a process (aka file) that no longer exists when trying to read or write to it. |
Then it would be good to note that in the original issue so the author knows they're mistaken or can clarify the situation in which |
This error occurs if the process to be read from or written to no longer exists.
Fixes #19875