Request for help debugging screen problem

Shaddy Baddah
Fri Feb 5 10:42:00 GMT 2010


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:

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);
228:   assert (_hPipe);
229:   assert (_hPipe != INVALID_HANDLE_VALUE);
230:   assert (!_is_listening_endpoint);
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:     }
240:   return count;
241: }

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,

More information about the Cygwin-developers mailing list