Test p{read,write}64 with offset > 4GB
commit3bbee82a56b38fc4ee28ecb59721ea1d42494642
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 12 Jul 2016 15:29:06 +0000 (12 08:29 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 12 Jul 2016 15:29:17 +0000 (12 08:29 -0700)
treeb7ad289bf50ad329916d21677c92130e8770206f
parent61655555aa8c2cd5f5351ef7d0aea6dfce046135
Test p{read,write}64 with offset > 4GB

Test p{read,write}64 with offset > 4GB.  Since it is not an error for a
successful pread/pwrite call to transfer fewer bytes than requested, we
should check if the return value is -1.   No need to close and unlink
temporary file, which is handled by test-skeleton.c.

[BZ #20350]
* posix/tst-preadwrite.c: Renamed to ...
* posix/tst-preadwrite-common.c: This.
(PREAD): Removed.
(PWRITE): Likewise.
(STRINGIFY): Likewise.
(STRINGIFY2): Likewise.
(do_prepare): Make it static and remove function arguments.
(do_test): Likewise.
(PREPARE): Updated.
(TEST_FUNCTION): New.
(name): Make it static.
(fd): Likewise.
(do_prepare): Use create_temp_file.
(do_test): Renamed to ...
(do_test_with_offset): This.  Make it static and accept offset.
Properly check return value of PWRITE and PREAD.  Return bytes
read.  Don't close fd nor unlink name.
* posix/tst-preadwrite.c: Rewrite.
* posix/tst-preadwrite64.c: Likewise.
ChangeLog
posix/tst-preadwrite-common.c [new file with mode: 0644]
posix/tst-preadwrite.c [copied from posix/tst-preadwrite64.c with 76% similarity]
posix/tst-preadwrite64.c