Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!hc!siegel From: siegel@hc.DSPO.GOV (Josh Siegel) Newsgroups: comp.bugs.4bsd Subject: Bug in select (on both Suns and BSD43) Message-ID: <11437@hc.DSPO.GOV> Date: Fri, 20-Nov-87 15:01:50 EST Article-I.D.: hc.11437 Posted: Fri Nov 20 15:01:50 1987 Date-Received: Sun, 22-Nov-87 15:12:05 EST Organization: Los Alamos National Laboratory Lines: 48 There seems to be a bug in select. If a person tells a tty to stop (^S), select will still return that there is data in the tty even while it won't send any of it. This causes programs that depend on select to multiplex to go block on reading that tty. The reason is the following... When I stop a tty, the following routine is called: . . . if ((tp->t_state&TS_TTSTOP) == 0) { tp->t_state |= TS_TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp, 0); } . . . The select looks like: case FREAD: nread = ttnread(tp); if ((nread > 0) || ((tp->t_state & TS_CARR_ON) == 0)) goto win; if (tp->t_rsel && tp->t_rsel->p_wchan == (caddr_t)&selwait) tp->t_state |= TS_RCOLL; else tp->t_rsel = u.u_procp; break; . . . return(0); win: return(1); I see no check in the select routine to see if the tty is stopped. As far as I am concerned, the file descripter is not ready for reading while it is stopped. Any comments? --Josh Siegel -- Josh Siegel (siegel@hc.dspo.gov) Friends don't let Friends eat Cherry Zingers