Re: [PATCH] kdesu broken

From: Linus Torvalds
Date: Tue Jul 28 2009 - 14:44:43 EST




On Tue, 28 Jul 2009, Alan Cox wrote:
>
> If you are asking that question I don't think you understand the bug
> report.

I don't think YOU understand what I'm saying.

> > The correct expectation is that the select() (or read()) should have
> > returned any data that it saw _before_ it returns EINTR.
>
> read() handles that correctly, has always done so.
>
> emacs from the traces does this
>
> set O_NDELAY
> wait for SIGCLD
> read()
> EAGAIN
> shit_myself();

Go back and read my email.

Emacs is ENTIRELY PROPER in doing that. If it has gotten the SIGCHLD, then
it damn well should know that the data is buffered already, since the
child sure as hell isn't writing any more. So if it gets EAGAIN due to the
SIGCHLD, it can assume that there isn't going to be any more data.

My point is that a program _should_ be able to depend on simple causality
when it comes to ordering rules. If the child did a write() before
exiting, then we should see the data before SIGCHLD.

It's really that simple.

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