Path: utzoo!attcan!uunet!comp.vuw.ac.nz!conrad From: Conrad.Bullock@comp.vuw.ac.nz (Conrad Bullock) Newsgroups: comp.unix.questions Subject: Accessing the tty structure. Keywords: internal tty structure Message-ID: <1990Sep27.234733.17938@comp.vuw.ac.nz> Date: 27 Sep 90 23:47:33 GMT Sender: news@comp.vuw.ac.nz (News Admin) Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Lines: 25 Nntp-Posting-Host: halswell.comp.vuw.ac.nz Originator: conrad@halswell.comp.vuw.ac.nz 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@comp.vuw.ac.nz Victoria University of Wellington, | or: conrad@actrix.co.nz New Zealand. | Fidonet: 3:771/100 | BBS: The Cave BBS +64 4 643429