Accessing the tty structure.

Conrad Bullock Conrad.Bullock at comp.vuw.ac.nz
Fri Sep 28 09:47:33 AEST 1990


I'm trying to port a locally written BBS package to an AT&T 3B2/400,
running Sys V Rel 3.0. The package was originally written under SCO
Xenix, and it made use of the rdchk() system call, to determine if
there were any characters waiting to be read.  I thought of the
FIONREAD ioctl, but that's not there. I got around the problem by
switching input to O_NDELAY mode, and using read to determine how many
characters were ready, but performance suffered considerably.

I'd like to switch back to blocking I/O, and be able to determine if
there are characters waiting to be read. I noticed that the internal
tty structure would allow me to determine this - I know that this
would be horribly unportable, but I don't care - I'd just like to get
it working under this Sys V 3.0 system.

Now - my question is - how can I get at the tty structure for the
current input terminal, so I can get at the info I'm after?

Thanks,


-- 
Conrad Bullock                     | Domain:   conrad at comp.vuw.ac.nz
Victoria University of Wellington, |     or:   conrad at actrix.co.nz
New Zealand.                       | Fidonet:  3:771/100
                                   | BBS:      The Cave BBS +64 4 643429



More information about the Comp.unix.questions mailing list