lkml.org 
[lkml]   [2009]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pipe: don't block after data has been written
On 2009/11/05 17:27, Eric Dumazet <eric.dumazet@gmail.com> 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."


\
 
 \ /
  Last update: 2009-11-05 17:39    [W:0.684 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site