C: SIGALRM – alarm to display message every second
Signal handlers are not supposed to contain “business logic” or make library calls such as printf. See C11 ยง7.1.4/4 and its footnote: Thus, a signal handler cannot, in general, call standard library functions. All the signal handler should do is set a flag to be acted upon by non-interrupt code, and unblock a waiting system … Read more