From owner-freebsd-current Mon Mar 20 11: 1:45 2000 Delivered-To: freebsd-current@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 6227837C346 for ; Mon, 20 Mar 2000 11:01:36 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.2) id LAA05709; Mon, 20 Mar 2000 11:00:57 -0800 (PST) From: Archie Cobbs Message-Id: <200003201900.LAA05709@bubba.whistle.com> Subject: Re: kern/8324 In-Reply-To: <200003181152.DAA29093@salsa.gv.tsc.tdk.com> from Don Lewis at "Mar 18, 2000 03:52:54 am" To: Don.Lewis@tsc.tdk.com (Don Lewis) Date: Mon, 20 Mar 2000 11:00:57 -0800 (PST) Cc: bright@wintelcom.net (Alfred Perlstein), freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Don Lewis writes: > } * Archie Cobbs [000317 17:55] wrote: > } > This bug has been around since at least 2.2.6 and is still present > } > in RELENG_3, RELENG_4, and -current. > } > > } > http://www.freebsd.org/cgi/query-pr.cgi?pr=8324 > } > > } > Is anyone planning to tackle it? What would be required to fix it? > } > (it's not clear (to me anyway) from Bruce's description how hard > } > this is to fix..) > > I never heard of using SIGIO for output, but section 6.4 of the daemon > book says that SIGIO is sent "when a read or write becomes possible". > On the other hand, section 10.8 (Terminal Operations) mentions SIGIO > for input but not for output. I also looked at rev 1.1 of kern/tty.c > and it only sends a SIGIO when input is ready, so this seems to be > the historical behaviour, so I'm suprised that this program even > worked with plain tty devices. > > } I think Bruce sort of went off into a tangent with his diagnosis, > } anyhow this is untested (of course :) ), but looks like the right > } thing to do (from sys_pipe.c). > } > } Perhaps the fcntls and ioctls aren't being propogated enough to set > } the flags properly, but if they are then it should work sort of the > } way SIGIO does, basically generating a signal for /some condition/ > } on a descriptor. > > This patch (vs the 3.4-STABLE version of tty.c) causes SIGIO to be > sent when a regular or pseudo tty becomes writeable. > > > --- tty.c.orig Sun Aug 29 09:26:09 1999 > +++ tty.c Sat Mar 18 03:09:32 2000 > @@ -2133,6 +2133,8 @@ > > if (tp->t_wsel.si_pid != 0 && tp->t_outq.c_cc <= tp->t_olowat) > selwakeup(&tp->t_wsel); > + if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL) > + pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL)); > if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) == > TS_SO_OCOMPLETE && tp->t_outq.c_cc == 0) { > CLR(tp->t_state, TS_SO_OCOMPLETE); > > > BTW, I had to add: > fcntl(1, F_SETOWN, getpid()); > to the test program since there is no longer a default target to send > the signal to. The old scheme had the defect of sending SIGIO to the > process group that owned the terminal, which implied that the terminal > had to be the controlling terminal for the process group. This limited > a process to only receiving SIGIO from one terminal device even if it > had more than one open and it wanted to receive SIGIO from all of them. > Also, SIGIO was sent to the entire process group, but it may be desireable > to limit this to one process. I wonder if it might make sense to go > back to the old default for tty devices so that processes only receive > SIGIO when they are in the foreground ... Don- After applying your patch to kern/tty.c and adding the F_SETOWN, the problem indeed seems to go away.. Is this patch ready to be committed, or do we need more reviewers? Thanks, -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message