Skip to content
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

ESRCH is not handled by file io operations #19875

Closed
breavyn opened this issue May 6, 2024 · 1 comment · Fixed by #21430
Closed

ESRCH is not handled by file io operations #19875

breavyn opened this issue May 6, 2024 · 1 comment · Fixed by #21430
Labels
bug Observed behavior contradicts documented or intended behavior os-linux standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@breavyn
Copy link

breavyn commented May 6, 2024

Zig Version

0.12.0

Steps to Reproduce and Observed Behavior

Reading or writing files under /proc/<pid>/ on linux can result in an ESRCH error if the related process has terminated.

Functions read, pread, readv, etc. and their write counterparts, seek, and possibly others, return error.Unexpected in this case.

Expected Behavior

Functions should return error.ProcessNotFound on ESRCH.

@breavyn breavyn added the bug Observed behavior contradicts documented or intended behavior label May 6, 2024
@Vexu Vexu added standard library This issue involves writing Zig code for the standard library. os-linux labels May 31, 2024
@Vexu Vexu added this to the 0.15.0 milestone May 31, 2024
chrboesch added a commit to chrboesch/zig that referenced this issue Sep 15, 2024
process.
This error occurs if the process to be read from or written to no longer exists.
Fixes ziglang#19875
@chrboesch
Copy link
Contributor

Reading or writing files under /proc// on linux can result in an ESRCH error if the related process has terminated.

Linux returns the ENOENT error for a process (aka file) that no longer exists when trying to read or write to it. So I added 'ProcessNotFound' on this.

Functions should return error.ProcessNotFound on ESRCH.

This error occurs when you try to kill a process or process group that no longer exists.

alexrp pushed a commit to chrboesch/zig that referenced this issue Oct 2, 2024
process.
This error occurs if the process to be read from or written to no longer exists.
Fixes ziglang#19875
alexrp pushed a commit that referenced this issue Oct 3, 2024
…ing in a Linux process (#21430)

* Added error message 'ProcessNotFound' for reading and writing in a Linux
process.
This error occurs if the process to be read from or written to no longer exists.
Fixes #19875

* Added error message "ProcessNotFound" for error forwarding.

* Add error messgae for forwarding.

* Added message for forwarding.

* Error set completed.

* Fixed format error.

* Changed comments to doc comments.
richerfu pushed a commit to richerfu/zig that referenced this issue Oct 28, 2024
…ing in a Linux process (ziglang#21430)

* Added error message 'ProcessNotFound' for reading and writing in a Linux
process.
This error occurs if the process to be read from or written to no longer exists.
Fixes ziglang#19875

* Added error message "ProcessNotFound" for error forwarding.

* Add error messgae for forwarding.

* Added message for forwarding.

* Error set completed.

* Fixed format error.

* Changed comments to doc comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior os-linux standard library This issue involves writing Zig code for the standard library.
Projects
None yet
3 participants