From: Steve M. Robbins (steve@Nyongwa.CAM.ORG)
Date: 08/01/92


From: steve@Nyongwa.CAM.ORG (Steve M. Robbins)
Subject: Is a signal supposed to screw up terminal reads?
Date: 1 Aug 1992 12:08:54 GMT

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