Messages in this thread | | | Date | Thu, 20 Nov 2008 16:47:19 +0000 | From | Alan Cox <> | Subject | Re: Question about TTY_DO_WRITE_WAKEUP |
| |
> > The base code should probably really use test_and_clear_bit() when > > calling that method. > > Why should you test it, clear it and set it again in n_tty_write_wakeup ?
Because it should only be set again if a wakeup is needed. If the fasync list for the tty is now empty it should stay clear.
> IMHO a SIGIO on write possible should always be generated if the user wants it, > currently it is generated when the user wants it and the tty driver enables the > TTY_DO_WRITE_WAKEUP flag. Unfortunately most drivers don't set it.
It is nothing to do with the driver. The line discipline sets it - or rather should set it. If you have a case where you get an EAGAIN or short write and the line discipline is not setting it then that is what needs fixing not the drivers.
> Once a write fails with EAGAIN a flag can be set and only in that case a SIGIO is > generated, afterwards the bit is cleared. Maybe that is what TTY_DO_WRITE_WAKEUP > was intended for.
Correct.
| |