setting cbreak/noecho under system V.2

Michael A. Cooper mcooper at usc-oberon.UUCP
Sat Jul 12 04:18:20 AEST 1986


I'm trying to figure out how to set some tty modes under System V.2 (on
a 3B20S) for a particulair application I have.  Since I'm a Berkeley UNIX
person, I have almost no System V background.  Anyway, I'm using the
following macros to accomplish my task:

#define crmode() 	(_tty.c_lflag &=~ICANON, _tty.c_cc[VMIN] = 1,\
				_tty.c_cc[VTIME] = 1,\
				ioctl(_tty_ch,TCSETAF,&_tty))
#define nocrmode() 	(_tty.c_lflag |= ICANON, stty(_tty_ch,&_tty))
#define echo()	 	(_tty.c_lflag |= ECHO, ioctl(_tty_ch, TCSETA, &_tty))
#define noecho() 	(_tty.c_lflag &=~ECHO, ioctl(_tty_ch, TCSETA, &_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).  

Would someone care to "enlighten" me to the System V idiosincroties of
tty modes?


-- 
Michael Cooper, U of Southern California Computing Services, (213) 743-3462
  UUCP: {sdcrdcf, uscvax}!usc-oberon!mcooper
  ARPA: mcooper at usc-oberon.arpa 		BITNET: mcooper at uscvaxq



More information about the Comp.unix.wizards mailing list