You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We might take inspiration from Qt5 Unix signal handling, that is use the famous pipe(7) to self trick. Then all the event loops should also poll(2) on that pipe (reading end) and the signal handler would write(2) at least a byte on that pipe (writing end).
We could also decide to declare some extern volatile sigatomic_t onion_should_stop; variable and have signal handlers setting onion_should_stop and have all the event loops testing that variable repeatedly.
The text was updated successfully, but these errors were encountered:
bstarynk
changed the title
unsafe fileserver.c example
unsafe fileserver.c example (about Unix signals)
Nov 21, 2020
In commit 2b3b230 the
fileserver.c
example has unsafe code about signal (near line 154, calling signal(2) ...)Read both signal(7) and signal-safety(7).
We might take inspiration from Qt5 Unix signal handling, that is use the famous pipe(7) to self trick. Then all the event loops should also poll(2) on that pipe (reading end) and the signal handler would write(2) at least a byte on that pipe (writing end).
We could also decide to declare some
extern volatile sigatomic_t onion_should_stop;
variable and have signal handlers settingonion_should_stop
and have all the event loops testing that variable repeatedly.The text was updated successfully, but these errors were encountered: