Hi Kostik,

2012/10/23 Konstantin Belousov <kostik...@gmail.com>:
> This is reproducable with the cat(1) as well. The telling part is that
> the backgrounded process stays on the "ttyin" cv. The code for e.g.
> tty read currently is structured as follows:
>         check for background process reading from CTTY, send SIGTTYIN
>         loop {
>                 sleep waiting for input
>                 process input
>         }
> The problem is that the SIGCONT does not remove the sleeping process from
> the sleep queue, so the sleep is not interrupted with error. Instead, the
> process is woken up later when input is available.
>
> Old tty code did the recheck for background state inside the loop after
> the sleep.

Exactly. Was just debugging this as well and came to the same
conclusion. Will try to come up with a decent patch tomorrow evening.

Thanks for reporting the issue!

-- 
Ed Schouten <e...@80386.nl>
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to