> 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/