[SystemZ][z/OS] Add guard for SI_USER - #213101
Conversation
|
@llvm/pr-subscribers-llvm-support Author: Abhina Sree (abhina-sree) ChangesSI_USER is not defined on z/OS and is causing the following build failure. This patch adds a guard to check whether SI_USER is defined before using it.
Full diff: https://github.com/llvm/llvm-project/pull/213101.diff 1 Files Affected:
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 69a80839c99d2..9453222cae546 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -477,7 +477,10 @@ static void SignalHandler(int Sig, siginfo_t *Info, void *Context) {
#endif
// Was the signal generated by kill(), sigqueue(), etc?
- bool ReraiseSignal = Info->si_code == SI_USER || Info->si_code == SI_QUEUE;
+ bool ReraiseSignal = Info->si_code == SI_QUEUE;
+#if defined(SI_USER)
+ ReraiseSignal |= Info->si_code == SI_USER;
+#endif
#if defined(SI_LWP)
// _lwp_kill() on BSDs, Solaris/illumos, possibly others.
ReraiseSignal |= Info->si_code == SI_LWP;
|
|
Fairly unusual for |
On z/OS, based on the documentation here I think si_code will be less than or equal to zero if the signal was generated by another process. Then si_pid and si_uid will have the process id and user id respectively |
|
If the signal came from another process -- i.e. |
I agree, I'm still working on investigating what the proper fix should be. In the interim, is this patch ok to unblock our build? https://lab.llvm.org/staging/#/builders/237/builds/26 |
SI_USER is not defined on z/OS and is causing the following build failure. This patch adds a guard to check whether SI_USER is defined before using it.
error: use of undeclared identifier 'SI_USER'