Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!inuxc!iuvax!pur-ee!ea.ecn.purdue.edu!davy From: davy@ea.ecn.purdue.edu.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: 4.2BSD / System V ioctl questions Message-ID: <416@ea.ecn.purdue.edu> Date: Fri, 28-Aug-87 00:13:19 EDT Article-I.D.: ea.416 Posted: Fri Aug 28 00:13:19 1987 Date-Received: Sat, 29-Aug-87 17:44:04 EDT References: <299@rruxa.UUCP> Reply-To: davy@ea.ecn.purdue.edu.UUCP (Dave Curry) Organization: Purdue University Engineering Computer Network Lines: 26 Xref: utgpu comp.unix.questions:3371 comp.unix.wizards:3649 In article <299@rruxa.UUCP> jpage@rruxa.UUCP (J Page) writes: > 1. how in System V can CBREAK / ~ECHO, be emulated ???? The System V ioctl is a gross hack. (Who in their right mind would hard-code ^S/^Q into the kernel?) Anyway, to do this, turn off canonical input processing and then set the minimum number of characters to return from reads on to 1, and the timeout to zero: struct terminfo tinfo; ioctl(0, TIOCGETA, &tinfo); tinfo.c_lflag &= ~(ICANON | ECHO); tinfo.c_cc[EOF] = 1; /* min chars to read */ tinfo.c_cc[EOL] = 0; /* timeout */ ioctl(0, TCSETA, &tinfo); > 2. are there (stty and gtty)-like calls available in System V. Nope. They're actually gone from 4.3BSD too; they're implemented as library routines. --Dave Curry Purdue University Engineering Computer Network