haiku/headers
Augustin Cavalier 3ecbb34240 IORequest: Correct major oversight in finished callback API.
The IORequest internally likes to deal with transferEndOffset
not transferredBytes because of sub-requests potentially being
prepared all at once (in some paths in the I/O scheduler),
thus fTransferSize can get incremented in Advance() before we have
actually executed that transfer.

But external consumers much prefer just knowing transferredBytes
not transferEndOffset. And many of them actually named their
variables that (or "bytesTransferred") and just passed the
transferEndOffset through to variables with that name! That's
obviously wrong, and it's surprising it wasn't discovered before now.

The problem was uncovered by repeated KDLs in PrecacheIO.
That method used the "bytesTransferred" value as a count of
pages transferred, which would then run past the end of the array
if the transfer start offset was not 0 (which the majority
of the time it would be, since this method gets called on
the first mmap() of a file, probably before any pages are read in.)

Most other consumers of this API did not check the value, it seems,
or otherwise had some mitigating factor that prevented it from
causing more problems. An exception is the page code, which
may have spuriously considered writes as successful when they
really weren't.

May fix some of the "invalid concurrent access to page" KDLs.
2024-08-09 18:04:27 -04:00
..
build elf: add PT_RISCV_ATTRIBUTES program header 2023-09-25 15:20:13 +00:00
compatibility pthread: Implement pthread_timedjoin_np. 2024-07-16 19:59:39 +00:00
config riscv: cleanup architecture macro checks 2021-09-01 18:04:59 +00:00
cpp userlandfs: use std::bitset for FSCapabilities 2023-07-10 06:27:18 +00:00
glibc Make public glibc header printf.h usable. 2013-07-17 18:07:56 +02:00
libs udis86: remove 2024-07-17 19:11:50 +00:00
os Versioning: Add BETA_5 and PRE_BETA_6 version constants. 2024-08-08 10:42:41 -04:00
posix POSIX: move getentropy(2) from libbsd 2024-07-16 16:09:00 +00:00
private IORequest: Correct major oversight in finished callback API. 2024-08-09 18:04:27 -04:00
tools cppunit: Enable CPPUNIT_HAVE_SSTREAM for the non-legacy GCC. 2022-03-29 19:09:38 -04:00