[PATCH v2] Fix LO_HI_LONG definition

Florian Weimer fweimer@redhat.com
Fri Jul 8 16:41:00 GMT 2016


On 07/07/2016 04:03 PM, Adhemerval Zanella wrote:
>
>
> On 07/07/2016 03:56, Florian Weimer wrote:
>> 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?
>
> Indeed, I have changed the testcase to check if returned file is indeed what
> the test expect.

Test case looks okay to me now.

I'm not sure about the correctness of the change, sorry.

Thanks,
Florian



More information about the Libc-alpha mailing list