From owner-freebsd-hackers Tue May 14 02:22:11 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA22626 for hackers-outgoing; Tue, 14 May 1996 02:22:11 -0700 (PDT) Received: from bowden.uces.bangor.ac.uk (bowden.uces.bangor.ac.uk [147.143.15.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id CAA22615 for ; Tue, 14 May 1996 02:21:45 -0700 (PDT) Received: from newton.uces (newton.uces.bangor.ac.uk) by bowden.uces.bangor.ac.uk; Tue, 14 May 96 10:20:04 BST Received: by newton.uces (SMI-8.6/SMI-SVR4) id KAA04825; Tue, 14 May 1996 10:20:44 +0100 Date: Tue, 14 May 1996 10:20:44 +0100 From: tom@uces.bangor.ac.uk (Tom Crummey (ADM)) Message-Id: <199605140920.KAA04825@newton.uces> To: freebsd-hackers@freebsd.org Subject: write and pty's X-Sun-Charset: US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hello, I sent this message to freebsd-questions, but it is probably better on this list. If you do reply to this, could you copy to me directly as I'm not on the hackers list (yet). Thanks. ----- Begin Included Message ----- >From owner-freebsd-questions@freefall.freebsd.org Fri May 10 02:01:21 1996 Original-Received: from localhost (daemon@localhost) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id PAA27629 Thu, 9 May 1996 15:31:30 -0700 (PDT) Pp-Warning: Illegal Received field on preceding line From: Tom Crummey (ADM) Subject: write and pty's To: freebsd-questions@freebsd.org Date: Thu, 9 May 96 23:29:56 BST X-Mailer: ELM [version 2.3 PL11] Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Content-Length: 1815 Hello, I have been trying to track down a problem in the xview library code which causes the cmdtool program to continuously output to the pty it is using. For example, start a cmdtool and type return. You will get a continuous stream of prompts as if you were continually typing the return key. After some hours with xxgdb and libraries compiled with debugging symbols, I tracked the problem to a write call. This write call returns 0 even though it appears that a charater has been written. The fact that this call returns 0 means that the write pointer in the cmdtool code is not updated and so it is written again etc. (you get the picture) It seems that there is a problem with the write system call returning 0 instead of the number of characters written in this particular case. The pty is supposedly not in remote mode. Does anyone have any idea why the write call would return 0 even when characters have been written? Could anyone who knows the pty kernel code comment? I can send the segment of code involved, but I suspect it won't help as there is too much context requried to see what is going on. I think I might be getting slightly out of my depth..... glug ..glug... I am running FreeBSD-2.2-SNAP 960128 with the xview-3.2 patched for X11R6. The problem also exists on 2.1-RELEASE. -- Tom. ---------------------------------------------------------------------------- Tom Crummey, EMAIL: tom@uces.bangor.ac.uk | /\ University of Wales, Bangor, | / \/\ Unit for Coastal and Estuarine Studies, | /\/ \ \ Ynys Faelog, Menai Bridge, TEL: +44 (0)1248 713808 |/ ======\=\ Gwynedd, LL59 5EY, U.K. FAX: +44 (0)1248 716729 | B A N G O R ---------------------------------------------------------------------------- ----- End Included Message -----