[mu TECH] signal() and alarm() in Linux

From: Michele Andreoli (andreoli@pisoft.it)
Date: Mon Feb 22 1999 - 15:37:58 CET


Very technical questions, related to C programming in Linux.

When I set an alarm with alarm(), any previously
set alarm is cancelled. I use signal() syscall. Anyone tell me
how to use sigaction() and if this syscall can resolve
this problem (i see similar solutions in loss article).

A this momement I restore , in the interrupt handler function,
a new alarm, in this way:

                signal(SIGALRM, reload);
                ....
                if (refr) alarm(refr_time);
                ...
                void reload(...) /* interrupt handler */
                {
                ... signal(SIGALRM,reload); ....
                }

I'm searching for a more elegant solutions, if any.

This question appair in muless, started in "refresh mode".
When i start muless with:

                muless -r 2 /proc/uptime

I wish muless reload the file any 2 seconds.

-Michele

-- 
Mi sarebbe piaciuto concludere con un'affermazione positiva, ma
non me ne vengono in mente. Vanno bene due negative?
						-- Woody Allen


This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:11 CET