lkml.org 
[lkml]   [2001]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: esound (esd), 2.4.[12] chopped up sound -- solved
On Tue, 20 Mar 2001, Doug Ledford wrote:

> Why would esd get a short write() unless it is opening the file in non
> blocking mode (which I didn't see when I was working on the i810 sound
> driver)? If esd is writing to a file in blocking mode and that write is
> returning short, then that sounds like a driver bug to me.

Please quote chapter and verse.

I'm looking at http://www.opengroup.org/onlinepubs/7908799/xsh/write.html
and cannot see anything which states that write may not return having
written fewer data than it was asked to.

The only vaguely relevant text I see is...

Write requests to a pipe or FIFO will be handled the same as a
regular file with the following exceptions:

<...>

* If the O_NONBLOCK flag is clear, a write request may cause the
thread to block, but on normal completion it will return
nbyte.

This being an _exception_ clearly implies that for file descriptors other
than pipes and fifos, it is _not_ necessary to return nbyte on normal
completion.

Applications (and also I believe glibc) which assume otherwise are,
technically, broken. Despite being numerous.

--
dwmw2


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

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