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" , "'Geoffrey Noer'" Cc: Keith Seitz 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.