October 2018
Beginner
794 pages
19h 23m
English
In the following, we display code snippets from our sample program ch13/react.c (see more on this rather interesting reaction time game app in the following section), which clearly illustrates the sequence of steps previously described.
struct sigaction act;[...]// Trap SIGRTMIN : delivered on (interval) timer expirymemset(&act, 0, sizeof(act));act.sa_flags = SA_SIGINFO | SA_RESTART;act.sa_sigaction = timer_handler;if (sigaction(SIGRTMIN, &act, NULL) == -1) FATAL("sigaction SIGRTMIN failed\n");
Read now
Unlock full access