gets() during signal

Darren Reed avalon at phoenix.pub.uu.oz.au
Sat Dec 15 13:37:57 AEST 1990



Can someone tell me how signals work inside C on unix ?
I've seen an alarm() used to timeout a write() call in something like this:

		alarm(15);
		write(fd, buf, num);

which caused the write to exit if it wasnt successful after 15 seconds.

I'm looking for a way of using 'HOT' keys in a program and I'd like to
use the keyboard to interrupt the program (cease whatever its doing) and
then go on to process the new keypress.  I noticed there is a SIGIO, but
from what I've read in the odd post, that needs some ioctl() or similar
calls to setup.

any info would be greatly appreciated.



More information about the Comp.unix.programmer mailing list