Sys 5.2 equivalents for FIONREAD and TIOC[SC]DTR

Chris Miller chris at hwcs.UUCP
Wed Sep 25 01:58:24 AEST 1985


I am trying to convert a program from a variant of 4.2bsd to System
V Release 2 as implemented on an NCR Tower.  A number of ioctl calls
need to be converted; I can cope with most of these, but am having
difficulty with:
	FIONREAD	returns the number of characters waiting on
			an input queue - really the program just needs
			to find out if anything has been typed ahead
			on the terminal.
	TIOCCDTR	Lower the Data Terminal Ready line. I know that
			this can be done by setting the HUPCL bit and
			closing the file descriptor *if* no other process
			has the descriptor open. Unfortunately, (i) some
			other process may share the descriptor and (ii)
			the program needs the descriptor to be open
			again shortly after, and doesn't have its pathname
			available to re-open it by!
	TIOCSDTR	Raise the DTR line - see the comments on TIOCCDTR
	TIOCMODG	Get modem status - the program can do without this
			if necessary, but it would be nice to know if there
			is a Sys V equivalent.

If exact translations are not possible, are there other ways of achieving
the same ends?

Responses by mail, please; RTFM flames not appreciated, since I have
Read The F(lipp)ing Manual to the best of my myopic ability, as well as
attacking it with copious doses of grep(1). I shall summarise to the net
if I discover anything non-trivial.

-- 
	Chris Miller, Heriot-Watt University, Edinburgh
	...!ukc!hwcs!chris   chris at hwcs.uucp	chris at cs.hw.ac.uk



More information about the Comp.unix.wizards mailing list