lkml.org 
[lkml]   [2000]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 0-byte read()/write() behaviour


On Fri, 20 Oct 2000, Philipp Rumpf wrote:
>
> Single Unix specifies that 0-byte reads, as well as 0-byte writes, should
> "return 0 and have no other results". Our current implementation violates
> the first requirement and makes it very easy to violate the second one.

Note that there _are_ cases where 0-byte reads and writes have specific
meaning, notably there are some networking things where a 0-byte sendto()
does something special if I remember correctly. And I seem to remember
that this also _did_ translate into write().

I remember that Linux used to do exactly this, and we had to pass the
0-byte writes into the low-level cases exactly because some low-level
cases do care. I suspect SUS only talks about regular files.

Linus

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

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.441 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site