Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site hwcs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!mcvax!ukc!cstvax!hwcs!chris From: chris@hwcs.UUCP (Chris Miller) Newsgroups: net.wanted,net.unix-wizards Subject: Sys 5.2 equivalents for FIONREAD and TIOC[SC]DTR Message-ID: <615@hwcs.UUCP> Date: Tue, 24-Sep-85 11:58:24 EDT Article-I.D.: hwcs.615 Posted: Tue Sep 24 11:58:24 1985 Date-Received: Fri, 20-Sep-85 06:39:33 EDT Reply-To: chris@hwcs.UUCP (Chris Miller) Organization: Computer Sci., Heriot-Watt U., Scotland Lines: 32 Xref: watmath net.wanted:7200 net.unix-wizards:14908 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@hwcs.uucp chris@cs.hw.ac.uk Brought to you by Super Global Mega Corp .com