Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!munnari!moncskermit!goanna!rcodi From: rcodi@goanna.UUCP Newsgroups: net.unix-wizards Subject: Re: setting cbreak/noecho under system V.2 Message-ID: <407@goanna.oz> Date: Thu, 17-Jul-86 23:05:45 EDT Article-I.D.: goanna.407 Posted: Thu Jul 17 23:05:45 1986 Date-Received: Sat, 19-Jul-86 22:24:51 EDT References: <520@usc-oberon.UUCP> Distribution: net Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 18 > #define crmode() (_tty.c_lflag &=~ICANON, _tty.c_cc[VMIN] = 1,\ > _tty.c_cc[VTIME] = 1,\ > ioctl(_tty_ch,TCSETAF,&_tty)) > The problem is that when I use the macros, I get logged out. I assume > because my tty "speed" is set to 0 (hangup). I suppose this is a silly question, but did you ioctl(_tty_ch, TCGETA, &_tty) before you used these macros? If you didn't, then the _tty structure would be all zeros if it is static, or all garbage if it is stack resident. You should also save VMIN and VTIME values in crmode(), and restore them in nocrmode() as they overlay EOF and EOL in the termio structure. If you don't, then your EOF and EOL characters will be incorrect in nocrmode(). It might be better to write routines rather than macros to do this properly. Ian Donaldson