From: ASA (llb@udm.net.ru)
Date: Tue 09 Oct 2001 - 13:07:17 IST
Hello linux-svgalib, > I use alarm() for a similar thing. just set up a signal handler that catches > SIGALRM, redraws the clock, and calls alarm(1) to update the clock once a > second. alarm(60) will update it once a minute. > > then, at the beginning of the program, just call alarm(60) once and away > you go. if you ever need to turn off the clock update, just do alarm(0). > > pretty simple. I noticed that SIGALRM can have issues with switching VT consoles, notable on "slow" machine with a 486 CPU, especially with "very slow" VESA console framebuffer device (kernel vesafb). My suggested patch (for 1.9.11) is: --- vga.c.llborigllb Tue Jul 31 23:23:11 2001 +++ vga.c Mon Oct 1 12:22:43 2001 @@ -61,6 +61,7 @@ sa.sa_handler = fun; \ sa.sa_flags = SA_RESTART; \ zero_sa_mask(&(sa.sa_mask)); \ + sigaddset(&sa.sa_mask,SIGALRM); \ sigaction(sig, &sa, NULL); \ } This patch fully resolves problem with breaking the image or incorrect displaying one. I suggest to make any means in order to have sa.sa_mask user-settable. This is might be good for complex programs that are relied on own signal handling. These means might look like predefined sigset_t variable, avaliable by public access. There is a string in the file doc/TODO: >really reliable vc switching. What did it mean? I think that the issue described above. -- Best regards, ASA mailto:llb@udm.net.ru ------------------------------------------------------------------ Unsubscribe: To: listbot@svgalib.org Body: unsubscribe linux-svgalib
This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST