aboutsummaryrefslogtreecommitdiff
path: root/io/test-lfs.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2015-08-10 14:12:47 +0200
committerAndreas Schwab <schwab@suse.de>2015-08-10 18:10:19 +0200
commiteb32b0d40308166c4d8f6330cc2958cb1e545075 (patch)
tree166e97f5cc58b9e6d18a4da5742ff5fc9e9a836b /io/test-lfs.c
parentd0649b2d8efca33363e399f1ba07d77e85901cfc (diff)
downloadglibc-eb32b0d40308166c4d8f6330cc2958cb1e545075.tar
glibc-eb32b0d40308166c4d8f6330cc2958cb1e545075.tar.gz
glibc-eb32b0d40308166c4d8f6330cc2958cb1e545075.tar.bz2
glibc-eb32b0d40308166c4d8f6330cc2958cb1e545075.zip
Readd O_LARGEFILE flag for openat64 (bug 18781)
Diffstat (limited to 'io/test-lfs.c')
-rw-r--r--io/test-lfs.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/io/test-lfs.c b/io/test-lfs.c
index 539c2a2b14..b6ebae403c 100644
--- a/io/test-lfs.c
+++ b/io/test-lfs.c
@@ -144,7 +144,7 @@ test_ftello (void)
int
do_test (int argc, char *argv[])
{
- int ret;
+ int ret, fd2;
struct stat64 statbuf;
ret = lseek64 (fd, TWO_GB+100, SEEK_SET);
@@ -195,6 +195,25 @@ do_test (int argc, char *argv[])
error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.",
(long long int) statbuf.st_size, (TWO_GB + 100 + 5));
+ fd2 = openat64 (AT_FDCWD, name, O_RDWR);
+ if (fd2 == -1)
+ {
+ if (errno == ENOSYS)
+ {
+ /* Silently ignore this test. */
+ error (0, 0, "openat64 is not supported");
+ }
+ else
+ error (EXIT_FAILURE, errno, "openat64 failed to open big file");
+ }
+ else
+ {
+ ret = close (fd2);
+
+ if (ret == -1)
+ error (EXIT_FAILURE, errno, "error closing file");
+ }
+
test_ftello ();
return 0;