runtime: use SA_RESTART when registering a signal

This really is the only sane way to register a signal. If this flag is
not set, many syscalls will return EINTR (and not complete their
operation) which will be a massive source of hard-to-debug bugs.
This commit is contained in:
Ayke van Laethem
2024-11-07 14:34:11 +01:00
committed by Ron Evans
parent 6601c1b1a6
commit 95671469c7
+1
View File
@@ -15,6 +15,7 @@ void tinygo_signal_handler(int sig);
void tinygo_signal_enable(uint32_t sig) {
struct sigaction act = { 0 };
act.sa_handler = &tinygo_signal_handler;
act.sa_flags = SA_RESTART;
sigaction(sig, &act, NULL);
}