On Sat, May 25, 2002 at 03:26:44PM +0200, Andreas Mohr wrote:
> I think the main question that this revolves around is what to do with
> odd-numbered/misaligned write() input in case of multi-byte audio formats.
> Should the kernel
> 1) discard odd remainders
> 2) tell the user program by returning incomplete counts that it discarded it
> 3) buffer unprocessable remainders for use in the next write()
> ?
2) Was the right answer for my own driver set, because it will
not loose data and is a common situation the user space app is
supposed to handle properly.
The only arguable case is if we use a count of 0 after
calculating (count & (align-1)), because we would basically
return EOF here instead of a short read (in the read case).
But it can be worked around by disallowing seeks or contraining the
seeks ;-)
PS: I know, we are talking about (short) writes here, but the
topic needs insight and I just handled these problems recently.
Regards
Ingo Oeser
-- Science is what we can tell a computer. Art is everything else. --- D.E.Knuth - 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 May 31 2002 - 22:00:19 EST