Xref: utzoo comp.unix.questions:19982 comp.unix.wizards:20637 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!jarthur!uci-ics!gateway From: bvickers@paris.ics.uci.edu (Brett Joseph Vickers) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Timed-out Input Keywords: System V - Yes, BSD- ??? Message-ID: <25DCE6F4.2232@paris.ics.uci.edu> Date: 17 Feb 90 05:53:56 GMT Organization: UC Irvine Department of ICS Lines: 41 Greetings, I have written a program using Xenix SysV and I am in the process of porting it over to BSD, but I've hit a glitch. The glitch occurs with my input processing. In the SysV version, I was using the termio structure to set a key-in timeout (termio.c_cc[VTIME]=3;). But when I moved over to BSD I was forced to use the sgttyb structure in conjunction with the ioctl() call. So far, I'm using the CBREAK mode, but this alone does not allow me to "time out" my inputs. Here is what I had in the System V version: foo() { struct termio temp; /* Using termio */ ioctl(0,TCGETA,&temp); temp.clflag &= ~(ICANON); temp.c_cc[VMIN] = 0; temp.c_cc[VTIME] = 3; /* Time out after .3 seconds */ ioctl(0,TCSETA,&temp); } And what I've got in the BSD version: bar() { struct sgttyb temp; ioctl(0,TIOCGETP,&temp); temp.sg_flags |= CBREAK; ioctl(0,TIOCSETP,&temp); } As you can see, I know of no way to time out raw or cbreaked input. Is there a way to do this with BSD? Thank you, bvickers@bonnie.ics.uci.edu