- extern void _sigtramp();
- struct __sigaction sa;
- struct __sigaction *sap;
-
- if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) {
- errno = EINVAL;
- return (-1);
+ int ret = __platform_sigaction(sig, nsv, osv);
+#ifdef FEATURE_SIGNAL_RESTRICTION
+ // Note: The "sig != 0" here is to force the compiler to maintain that "sig"
+ // is live, and in a register, after __sigaction so it is visible in the
+ // crashing register state.
+ if (ret == -1 && errno == ENOTSUP && sig != 0) {
+ CRSetCrashLogMessage("sigaction on fatal signals is not supported");
+ __builtin_trap();