[fpc-devel]SIGALRM?

Alejandro Néstor Vargas anv at lanet.com.ar
Wed Feb 21 19:49:36 CET 2001


For the Linux gurus:

I'm writing a program in fpc that does direct access to the tty using raw 
mode. I can't use the CRT unit because it initializes the screen and sends 
some escape sequences at the beginning of the program. Then I copied some 
parts of CRT unit like delay and setmode. I also created a function for 
checking if there are characters waiting to be readed from standard input. 

function InputPending: boolean;
var
  fdsin : fdSet;
begin
FD_Zero(fdsin);
fd_Set(0,fdsin);
InputPending:=(Select(1, at fdsin,nil,nil,nil)>0);
end;
 
Procedure Delay(DTime: Word);
Begin
    Select(0,nil,nil,nil,DTime);
End;                                                                          
    

The program works right, but there is a problem. Randomly, some time after 
the program is running, it receives a SIGALRM from the system and it ends. I 
solved it by trapping this signal, but... anybody knows why it signal is 
generated?

-- 
Alejandro Néstor Vargas
anv at lanet.com.ar




More information about the fpc-devel mailing list