From owner-freebsd-hackers Thu Apr 11 18:26:34 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA04837 for hackers-outgoing; Thu, 11 Apr 1996 18:26:34 -0700 (PDT) Received: from edna.bus.net (edna.bus.net [207.41.24.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id SAA04829 for ; Thu, 11 Apr 1996 18:26:29 -0700 (PDT) Received: (from chuck@localhost) by edna.bus.net (8.6.12/8.6.12) id VAA06549; Thu, 11 Apr 1996 21:25:26 -0400 Date: Thu, 11 Apr 1996 21:25:26 -0400 (EDT) From: "Chuck O'Donnell" To: Joerg Wunsch cc: freebsd-hackers@freebsd.org Subject: Re: fbsd pty bug In-Reply-To: <199604112201.AAA06483@uriah.heep.sax.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Joerg, I have forwarded your message to D. Hugh Redelmeier , who is one of the authors of jove. The comments you referred to are his and I am not qualified to answer. As a side note, if jove were to have retried the write with the fbsd pty bug, this would have made for some real trouble! But I believe that they will make the proper changes to jove now that it has been brought to their attention. Thanks for your interest. Regards, Chuck On Fri, 12 Apr 1996, J Wunsch wrote: > As Chuck O'Donnell wrote: > > While there's admittedly some bogosity with the pty handling (simple > evidence: run ``cat < /dev/ttypf'' in one window, and say ``echo hello > > /dev/ptypf'' in another one -- nothing will show up in the first > window), a couple of nits: > > > so jove is being told that the write was successful, but 0 > > bytes were written! Jove only checks whether the write was > > successful, and doesn't pay attention to the length reported by > > write. Jove will not retry this write, although that would be > > reasonable. > > I would consider this an error: > > NAME > write, writev - write output > ... > When using non-blocking I/O on objects such as sockets that are subject > to flow control, write() and writev() may write fewer bytes than request- > ed; the return value must be noted, and the remainder of the operation > should be retried when possible. > > Now it's arguable whether a pty counts as ``subject to flow control'', > but a short write is IMHO not an exception. > > > Notice that the amount returned by the read was the length > > requested by bash. I think that a pty should return at most a > > line at a time, even if the read requested more. > > What does make you think this? Tty's are not inherently line-bound, > so if there were more than a line available (regardles of your actual > problem with the multiple copies here), why should a read() only > return one line? > > -- > cheers, J"org > > joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE > Never trust an operating system you don't have sources for. ;-) >