Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 May 96 23:29:56 BST
From:      Tom Crummey (ADM) <tom@uces.bangor.ac.uk>
To:        freebsd-questions@freebsd.org
Subject:   write and pty's
Message-ID:  <16010.9605092229@bowden.uces.bangor.ac.uk>

next in thread | raw e-mail | index | archive | help
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...
-- 
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
----------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16010.9605092229>