-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add signal checking to waitpid_syscall #228
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
base: main
Are you sure you want to change the base?
Conversation
Commit 300bdeb: Build Success |
Test Report |
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.
Minor comment but looks good overall!
Commit d83aa7a: Build Success |
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.
Looks good to me now.
Commit d83aa7a: Build Success |
Test Report |
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.
Looks good to me.
Sorry for accidentally hitting the close button. I just wanted to point out that clippy has a bunch of error messages now, which don't all seem related to this PR likely for the reasons described in #220. |
Commit d83aa7a: Build Success |
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.
I would have some thoughts on whether to place the signal check at the beginning of the loop, or right after thread yield. Putting the signal check right after thread yield (i.e. after interface::lind_yield
) makes more sense to me since it ensures that waitpid
is only interruptible when it's actually about to wait. If we check for signals at the start of the loop, we could end up interrupting even when the child has already exited, which seems unnecessary. What do you think @rennergade
That makes sense to me as well. Also from reviewing the manpage it seems like we should only return EINTR if WNOHANG isn't set. |
Description
Fixes #118 (Blocking Calls for Signals) (waitpid)
This PR adds signal checking to the
waitpid_syscall
function to properly handle interruptions by signals. The changes ensure thatwaitpid
returnsEINTR
when interrupted by signals, matching POSIX behavior. This is a critical fix for proper signal handling in the system.Type of change
How Has This Been Tested?
cargo build
Checklist: