Files.read/readAllBytes can loop once with zero size buffer
Bernd Eckenfels
ecki at zusammenkunft.net
Fri Jul 29 23:19:27 UTC 2016
Hello,
BTW: I think accessing named pipes/fifos would have the same "problem".
But I guess nobody would use readAllBytes() on them :)
Gruss
Bernd
Am Fri, 29 Jul 2016 21:46:03 +0100
schrieb Alan Bateman <Alan.Bateman at oracle.com>:
> On 29/07/2016 19:36, Martin Buchholz wrote:
>
> > I think keeping the status quo is the right outcome. The /proc
> > filesystem is intentionally providing incorrect information because
> > providing correct information is deemed to be too expensive (have
> > to compute contents of file for stat?). Reading /proc is
> > sufficiently expensive that the extra realloc of an empty buffer is
> > noise. Be thankful that reading files in /proc works at all!
> >
> >
> and just to add that we have a file specifically for /proc as it used
> to cause problems in early versions.
>
> -Alan
More information about the core-libs-dev
mailing list