Il giorno lun 15 dic 2025 alle ore 11:25 Collin Funk
<[email protected]> ha scritto:
>
> Matteo Croce <[email protected]> writes:
>
> > Il giorno dom 14 dic 2025 alle ore 01:44 Paul Eggert
> > <[email protected]> ha scritto:
> >>
> >> On 2025-12-13 08:09, Matteo Croce wrote:
> >> > That was the purpose of the patch, even if maybe I should calculate it
> >> > by using sysconf(_SC_PAGESIZE).
> >>
> >> OK, but I'm not seeing why the patch would be a good idea for the
> >> coreutils master branch. Without the patch, doesn't 'cat' work well on
> >> all porting targets? Why add an unnecessary syscall?
> >
> > Which syscall? sysconf doesn't ask the kernel for page size.
>
> Assuming he means getpagesize, for systems without _SC_PAGESIZE (Not
> sure if any common systems are missing that nowawadays).
>
> Collin
Got it.
Anyway, doing IO operations on Linux bigger than MAX_RW_COUNT will
almost always do a short read/write.
This is noticeable with 'dd' without the option iflag=fullblock:
$ dd if=/dev/zero bs=1G count=2 |sha1sum
2+0 records in
2+0 records out
2147483648 bytes (2,1 GB, 2,0 GiB) copied, 1,53035 s, 1,4 GB/s
91d50642dd930e9542c39d36f0516d45f4e1af0d -
$ dd if=/dev/zero bs=2G count=1 |sha1sum
0+1 records in
0+1 records out
2147467264 bytes (2,1 GB, 2,0 GiB) copied, 1,60673 s, 1,3 GB/s
c4611e872c5a80623c67d39c6a5888c481565045 -
--
Matteo Croce
perl -e 'for($t=0;;$t++){print chr($t*($t>>8|$t>>13)&255)}' |aplay