[PATCH] POLL_OUT for tty drivers

From: Sapan J . Bhatia (lists@corewars.org)
Date: Sat Mar 23 2002 - 15:35:16 EST


Hello,

While fixing a flow control bug that truncated output to a terminal in
User Mode Linux, I noticed that the tty drivers only send POLL_IN on new
data being available but not POLL_OUT when the device is ready for new
data. This is quite important for processes that use ASYNC IO, since if
they're using POLLIN already, it doesn't make sense to employ an alternative
method for POLLOUT

This patch fixes the bug in the line discipline and the pty driver.

Also, there's another minor bug in n_tty.c where write_chan returns
on a (retvalue < 0) unconditionally. This is a problem, since the type of
IO (BLOCKING / NON_BLOCKING) is stored in the tty, and if the console driver
returns a -EAGAIN (eg. in UML on getting an EAGAIN from the host kernel),
write_chan returns even in the case of a blocking write, which is wrong
since the process doesn't expect it.

Regards,
Sapan



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Mar 23 2002 - 22:00:30 EST