Re: [PATCH] pipe: don't block after data has been written

From: Max Kellermann
Date: Thu Nov 05 2009 - 11:36:11 EST


On 2009/11/05 17:27, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> Your patch breaks many programs, that dont use poll()/select()
>
> char result[1000000];
> main()
> {
> computethings();
> write(1, buffer, 1000000);
> }

Your code does not check the return value of write(). This is a bug.

So how exactly does my patch break this program?

Let's read some more of the manual you cited: "If a write() requests
that more bytes be written than there is room for (for example, the
process' file size limit or the physical end of a medium), only as
many bytes as there is room for shall be written."
--
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/