Re: esound (esd), 2.4.[12] chopped up sound -- solved

From: David Woodhouse (dwmw2@infradead.org)
Date: Tue Mar 20 2001 - 17:37:56 EST


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/



This archive was generated by hypermail 2b29 : Fri Mar 23 2001 - 21:00:14 EST