[comp.unix.questions] Need a SIGIO example

fuller@isctsse.UUCP (Bill Fuller) (05/10/89)

Hi,

	I am looking for a coding example of using SIGIO to trigger a signal
on a serial port on a BSD4.3 compatible system (SunOS 4.0.1 to be exact). I
have done interrupt I/O on PC based product, but I have never tried it on
a unix box. 

	Here is a brief description of what I have, and of course, it does
not work.

	1) open the port
	2) use ioctl using TIOEXCL
	3) do a fcntl on port using F_SETFL to set FASYNC
	4) get the tty state using ioctl and TIOGETP
	5) Update the baud and settings
	6) Call ioctl with TIOSETP and the new settings
	7) flush the port using ioctl and TIOCFLUSH

	8) do a signal() call setting up as
		signal ( SIGIO, myroutine );

	9) Then drop into a pause state waiting for IO
		on the port,  but none ever comes even though
		I know that characters are being put on the device.

	I know that I am missing something, but I am new to UNIX communications.

				All suggestions welcome!

					Thanks,

					Bill F.