Mail Archives: djgpp/1998/09/01/05:39:41
Hello,
I have two questions:
1.) See this demo program:
----
#include <stdio.h>
#include <signal.h>
static void sig_alarm (int sig)
{ static nr = 0;
printf ("Seconds: %d\n", ++nr);
#ifdef unix
signal (SIGALRM, sig_alarm);
#endif
alarm (1);
}
int main ()
{
int i = 1;
if (SIG_ERR == signal (SIGALRM, sig_alarm))
{ puts ("SIG_ERR!");
return 1;
}
alarm (1);
while (' ' != getchar ());
return 0;
}
----
The signal handler should normally be called every 1 second.
But what happens is that it is called only after a key is pressed.
Is this a bug or a feature with DJGPP?
(By the way: Another stange behaviour occurs when I replace the
whole line that contains the "while"-statement with a simple
"while (1);": The program hangs (CTRL-C does not work, no output is
shown), but a "while (1);" works then. Why this?!?
2. ) When in Standard-VGA graphics mode, text output will be displayed
on the screen, too. How can this be done in VESA/Super-VGA
modes (here the output is not shown) ?
Any comment is welcome!
Many thanks in advance
Jens
--
| | | Jens Bischoff | Daimler-Benz Aerospace Airbus |
| --<O>-- +-----------------+---------------------------------+
| | | Aerodynamic Data Department (EFD) |
| Dasa Airbus | Huenefeldstrasse 1-5 D-28199 Bremen (Germany) |
- Raw text -