This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Request for help debugging screen problem
- From: Shaddy Baddah <helium at shaddybaddah dot name>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 05 Feb 2010 10:42:09 +0000
- Subject: Request for help debugging screen problem
Hi,
I'm trying to debug a problem with screen, rather than publish a bug
report. I can do that as well if someone requests it, no problem.
The issue I'm facing is with a read on the Windows named pipe associated
with a tty device. I note that in this bit of code:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygserver/transport_pipes.cc?annotate=1.12&cvsroot=src
223: ssize_t
224: transport_layer_pipes::read (void *const buf, const size_t len)
225: {
226: // verbose: debug_printf ("reading from pipe %p", _hPipe);
227:
228: assert (_hPipe);
229: assert (_hPipe != INVALID_HANDLE_VALUE);
230: assert (!_is_listening_endpoint);
231:
232: DWORD count;
233: if (!ReadFile (_hPipe, buf, len, &count, NULL))
234: {
235: debug_printf ("error reading from pipe (%lu)", GetLastError ());
236: SET_ERRNO (EINVAL); // FIXME?
237: return -1;
238: }
239:
240: return count;
241: }
242:
before and after the ReadFile the error code can return a different
value. ie. a call to the following function, returns different values:
ssize_t client_request::error_code() const;
I'm curious as to how this could be. Is there some callback function
registered via the Windows API that ReadFile calls at various points in
its execution? Or is another thread setting this value?
Any help would be greatly appreciated.
Thanks in advance,
Shaddy