www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/04/15/23:53:03

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: Nonblocking serial reads
15 Apr 1998 23:53:03 -0700 :
Message-ID: <01BD6924.757AE790.cygnus.cygwin32.developers@drs>
To: "cygwin32-developers AT cygnus DOT com" <cygwin32-developers AT cygnus DOT com>,
"'Geoffrey Noer'" <noer AT cygnus DOT com>
Cc: Keith Seitz <keiths AT cygnus DOT com>

Geoffrey Noer wrote:
> It looks like the solution has already been implemented in tty.cc (see
> fhandler_tty_slave::read).  Where should this code actually be?  Could
> we just make it more generic and then move it to fhandler_base?
>

The common solution is already implemented in _read() (syscalls.cc) - if 
non-blocking I/O is set, call select() to check data existance. The problem 
is in a select() code - class fhandler_serial inherits always_read_ready() 
from fhandler_base as "return 1;" :-) Add the following line into 
fhandler_serial class definition in fhandler.h:

   virtual const int always_read_ready (void) { return 0;}

--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019