[comp.sys.mac.programmer] LSC 3.0 & signal

mikeoro@hubcap.UUCP (Michael K O'Rourke) (01/31/89)

I think a friend of mine found a bug in LSC 3.0. We were porting a program
from the VAX running Unix to the Mac. It was a very simple shell that used
the signal command to jump out whenever control c was hit. The program is
only about 10 lines and works fine on the VAX. When we brought it to the mac,
however, the signal command didn't seem to work.  We can hit control/command
c and period as much as we want and it never breaks out. Has anyone else tried
using the signal command in LSC 3.0?  My guess is that there is some faulty
implementation cause we have taking it to numerous professors and the comupter
center and no one can find anything wrong.  Once again, the same program runs
fine on the VAX.

What's up Rich? Did we find a bug or what?

Michael O'Rourke
Clemson University

oster@dewey.soe.berkeley.edu (David Phillip Oster) (01/31/89)

In article <4256@hubcap.UUCP> mikeoro@hubcap.UUCP (Michael K O'Rourke) writes:
>I think a friend of mine found a bug in LSC 3.0. We were porting a program
>from the VAX running Unix to the Mac. It was a very simple shell that used
>the signal command to jump out whenever control c was hit.

Unix is not the natural universe! Nowhere in the C standard does it say
that control-c generates a signal.  That is a feature provided by some
tty drivers under some versions of unix. If you write a terminal driver
for the stdio section of lightspeed C, you can make it generate a signal
when you type a control-c also. (Also, remember that unix tty drivers run
off of serial interrupts, so the signal will be generated even if your C
program is infinite looping.  Handling the keyboard at interrupt level is
normally not in the domain of a user program on the mac.)