On Sat, 5 Jun 2010, Sergei Gavrikov wrote:
On Wed, 2 Jun 2010, Jay Foster wrote:
The attached patch fixes tcflush() and tcdrain() in the termios
package. These functions would call the fo_getinfo() function of the
file system code with a 0 length (the length value is unused). The
fo_getinfo() code in devfs.cxx would then convert this into a non-NULL
pointer to a value of 0 when calling cyg_io_get_config(). This
combination (non-NULL pointer to 0 value) is a special case in
cyg_io_get_config() used to determine if the get_config method is
available for the device. It always returns success (ENOERR) when the
method is defined and does nothing.
By changing the length value passed to the fo_getinfo() function to a
non-zero value, this avoids this.
Hi Jay,
Thank you for good catch!
RFC: May be we need even in an one-line comment/note in termios.c to
notice user about that "strange" length? Or may be to use some local
macro there, e.g.
#define NOBUF_NOCHECK NULL,1
I need to have the best opinion. Jifl?
To save time on testing.
I forgot to mention that was not only 'a backtrace/code view in mind'
from my side. Yesterday, I did a gDebuging a real termios example on
synthetic target. So, I confirm the Jay's report and confirm that his
workaround fixes the issue.
Sergei