[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] [BUG] serious bug in vu_write_retry?
From: |
Tom Lord |
Subject: |
Re: [Gnu-arch-users] [BUG] serious bug in vu_write_retry? |
Date: |
Fri, 9 Jul 2004 08:45:49 -0700 (PDT) |
> From: Aaron Bentley <address@hidden>
> I'm not so sure about the interface itself. Shouldn't it return
> a short count if it partially succeeds?
No.
vu_write_retry calls vu_write in a loop, ignoring EAGAIN and EINTR
errors, adding up short writes until the full amount of the original
write has been written.
What happens if some _other_ error is returned from either vu_write or
vu_read in those loops? In those cases, we simply don't know what has
been read or written: most bets are off. There is no portably correct
and interestingly useful short count to return for other errors.
(Besides which, the _retry functions are specifically for cases when
the caller classifies the outcomes of the read or write as either
"completely succeeded" or "failed in a way that suggests resuming the
read or write is pointless". Allowing the _retry functions to
return a partial count would make them the same, for nearly all
practical purposes as plain old read/write: there'd be no point to
having the _retry functions at all.)
-t