User-space interrupts
User-space interrupts
Posted Oct 12, 2021 22:54 UTC (Tue) by mpr22 (subscriber, #60784)In reply to: User-space interrupts by anton
Parent article: User-space interrupts
Imagine further that you send that daemon SIGHUP, telling it to reload its configuration files.
Do you really want it to wait until it receives its next packet before reloading its configuration files? After all, your config change might mean it needs to close one or more of the sockets it's currently waiting on and/or open new sockets.
I don't.
I'd much rather that its signal handler for SIGHUP just sets a flag saying "config must be reloaded", and that the system call wrapper then returns -1 and sets errno to EINTR, so that my daemon can check its config-reload flag and go "oh hey I've been reconfigured".