login
Header Space

 
 

Signals are screwing up my tty reads.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Tuesday, August 4, 1992 - 8:08 am

I have a program which reads in lines from a terminal using fgets().
Normally this means I can use the backspace key for editing, and my program
doesn't see this; it simply gets the edited line.

Then, I wanted some daemons executed periodically, regardless of what the
user is doing, so I used alarm().  All my SIGALRM handler does is call
signal() and alarm() again.  Suddenly line-editing no longer works.

That is, it works between alarms, but as soon as the signal hits, I can no 
longer backspace over what is already in the buffer.

1.  How do I make it not do this?

2.  Is POSIX supposed to do this?  I couldn't find any mention of this situation
in my POSIX Programmer's Guide.  I tested the code on an Ultrix and a NeXT, and
neither of them had this trouble.

This is with 0.96c pl2 and gcc 2.2.2d.

-- 
Steve Robbins  --  steve@nyongwa.cam.org
All the nightmares came today
And it looks as though they're here to stay


-- 
Steve Robbins  --  steve@nyongwa.cam.org
They paved paradise -- to put up a parking lot
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Signals are screwing up my tty reads., Steve M. Robbins, (Tue Aug 4, 8:08 am)
speck-geostationary