5/8/2009 (Quarta-feira) – 16:48
This is a simple way to make a code be executed from time to time, using alarm().
#include
#include
#include
static void
run(int signal)
{
printf(“signal = %i\n”, signal);
alarm(1);
}
int main(int argc, char **argv)
{
struct sigaction act;
act.sa_handler = run;
if(sigaction(SIGALRM, &act, NULL))
[...]
5/8/2009 (Quarta-feira) – 16:02
They don’t really create the directory. They just turn on and off listening to them.
5/8/2009 (Quarta-feira) – 15:59
When a signal is emitted a lot of times, and the processing of the action associated with the signal is expensive, it’s an option to only run the action when the system is idle. Using this function in this manner, this result can be achieved. I got to know this talking to pierlux [...]