-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[libc][wait] hard code __W_CONTINUED for SYS_waitid fallback #125929
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
Conversation
riscv32 currently doesn't have SYS_wait4, so wait4 is implemented via fallback to SYS_waitid. In llvm#125572, I missed that we had one use of the removed __W_CONTINUED value. Hard code it here. Fixes: llvm#125572
@llvm/pr-subscribers-libc Author: Nick Desaulniers (nickdesaulniers) Changesriscv32 currently doesn't have SYS_wait4, so wait4 is implemented via fallback Fixes: #125572 Full diff: https://github.com/llvm/llvm-project/pull/125929.diff 1 Files Affected:
diff --git a/libc/src/sys/wait/wait4Impl.h b/libc/src/sys/wait/wait4Impl.h
index 5c2cb3e8e0abf4..ec84eee491de24 100644
--- a/libc/src/sys/wait/wait4Impl.h
+++ b/libc/src/sys/wait/wait4Impl.h
@@ -65,7 +65,7 @@ LIBC_INLINE ErrorOr<pid_t> wait4impl(pid_t pid, int *wait_status, int options,
*wait_status = W_STOPCODE(info.si_status);
break;
case CLD_CONTINUED:
- *wait_status = __W_CONTINUED;
+ *wait_status = 0xffff;
break;
default:
*wait_status = 0;
|
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.
LGTM, but we should look into adding some macro to define this value as a followup. It looks like the same value is used in WIFCONTINUED
I think end users are supposed to use |
@SchrodingerZhu seems like the windows presubmit bot is failing to install sccache. https://github.com/llvm/llvm-project/actions/runs/13166422042/job/36747558716?pr=125929
Guessing that's referring to SSL cert revocation lists; sounds like someone is having an outage somewhere today! |
@@ -65,7 +65,7 @@ LIBC_INLINE ErrorOr<pid_t> wait4impl(pid_t pid, int *wait_status, int options, | |||
*wait_status = W_STOPCODE(info.si_status); | |||
break; | |||
case CLD_CONTINUED: | |||
*wait_status = __W_CONTINUED; | |||
*wait_status = 0xffff; |
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.
Can you add some comments about the hardcoded value and why we don't use the macro?
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.
ah, sorry, mid air collision. I'll post another patch.
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.
…5929) riscv32 currently doesn't have SYS_wait4, so wait4 is implemented via fallback to SYS_waitid. In llvm#125572, I missed that we had one use of the removed __W_CONTINUED value. Hard code it here. Fixes: llvm#125572
riscv32 currently doesn't have SYS_wait4, so wait4 is implemented via fallback
to SYS_waitid. In #125572, I missed that we had one use of the removed
__W_CONTINUED value. Hard code it here.
Fixes: #125572