https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91030
--- Comment #28 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to Jerry DeLisle from comment #27) > (In reply to Thomas Koenig from comment #26) > > Jerry, you are working on a Linux box, right? What does > > > > stat -f -c %b . > > > > tell you? > > 13429330 So we cannot really take the values from the file system for the buffer size at face value, at least not for determining the buffer size for this particular case. Last question (grasping at straws here): Are the values from comment #24 reproducible, do you always get this big jump for block size 6553? If they are indeed reproducible, I would suggest using an approach slightly modified from the attached patch: For formatted files, chose the value that the user supplied via an environment variable, or 8192 otherwise. (Formatted is so slow that we might as well save the memory). For formatted files, chose the value that the user supplied via an environment variable. If the user supplied nothing, then - query the recommended block size via calling fstat and evaluating st_blksize. - If st_blksize is less than 8192, use 8192 (current behavior) - if st_blksize is more than 32768, use 32768 - otherwise use st_blksize How does that sound?