mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 15:38:22 +00:00
Rosetta does something strange to the signal handling registers but setting SA_SIGINFO prevents the issue from happening. Set the flag on XNU to work around the issue.
This commit is contained in:
parent
1ce101c5a5
commit
2827df688a
1 changed files with 4 additions and 0 deletions
|
@ -183,6 +183,10 @@ static int __sigaction(int sig, const struct sigaction *act,
|
||||||
if (IsXnu()) {
|
if (IsXnu()) {
|
||||||
ap->sa_restorer = (void *)&__sigenter_xnu;
|
ap->sa_restorer = (void *)&__sigenter_xnu;
|
||||||
ap->sa_handler = (void *)&__sigenter_xnu;
|
ap->sa_handler = (void *)&__sigenter_xnu;
|
||||||
|
|
||||||
|
// mitigate Rosetta signal handling strangeness
|
||||||
|
// https://github.com/jart/cosmopolitan/issues/455
|
||||||
|
ap->sa_flags |= SA_SIGINFO;
|
||||||
} else if (IsLinux()) {
|
} else if (IsLinux()) {
|
||||||
if (!(ap->sa_flags & SA_RESTORER)) {
|
if (!(ap->sa_flags & SA_RESTORER)) {
|
||||||
ap->sa_flags |= SA_RESTORER;
|
ap->sa_flags |= SA_RESTORER;
|
||||||
|
|
Loading…
Add table
Reference in a new issue