[PATCH v2] Fix LO_HI_LONG definition

Florian Weimer fweimer@redhat.com
Thu Jul 7 06:57:00 GMT 2016


On 07/06/2016 09:52 PM, Adhemerval Zanella wrote:
> +  /* Create a sparse file larger than 4GB to check if offset is handled
> +     correctly in p{write,read}v64. */
> +  off_t base_offset = UINT32_MAX;
> +  off_t fsize = base_offset + 2048;
> +  if (ftruncate (temp_fd, fsize) != 0)
> +    {
> +      printf ("error: ftruncate (%jd) failed: %m", (intmax_t) fsize);
> +      return 1;
> +    }

I don't think this is is necessary.  You should be able to write beyond 
the current EOF and get a sparse file directly.

I'm not sure if the current tests catch calling convention errors 
because the read and write offsets could be mangled in the same way. 
Maybe you can add a test which performs a pwrite with a large offset and 
check that the file size reported by fstat is as expected?

Thanks,
Florian



More information about the Libc-alpha mailing list