summary refs log tree commit diff
path: root/misc/tst-preadvwritev-common.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-08-21 12:56:53 +0200
committerFlorian Weimer <fweimer@redhat.com>2018-08-21 12:56:53 +0200
commitaa42b3dbcb0326badf377fec2c7fb2f34fdabecd (patch)
tree818cd4e9c75b0dba8c982ce5d3b5def2d358ba05 /misc/tst-preadvwritev-common.c
parentc7627f41baaeb7f1a7b73ff66ef48eaafc1990f6 (diff)
downloadglibc-aa42b3dbcb0326badf377fec2c7fb2f34fdabecd.tar.gz
glibc-aa42b3dbcb0326badf377fec2c7fb2f34fdabecd.tar.xz
glibc-aa42b3dbcb0326badf377fec2c7fb2f34fdabecd.zip
Avoid running some tests if the file system does not support holes
Otherwise, these tests fills up the entire disk (or just run very
slowly and eventually time out).
Diffstat (limited to 'misc/tst-preadvwritev-common.c')
-rw-r--r--misc/tst-preadvwritev-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/tst-preadvwritev-common.c b/misc/tst-preadvwritev-common.c
index b59a3de465..4a5e53a140 100644
--- a/misc/tst-preadvwritev-common.c
+++ b/misc/tst-preadvwritev-common.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <array_length.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <errno.h>
@@ -26,10 +27,12 @@
 
 #include <support/check.h>
 #include <support/temp_file.h>
+#include <support/support.h>
 #include <support/xunistd.h>
 
 static char *temp_filename;
 static int temp_fd;
+static bool temp_fd_supports_holes;
 
 static int do_test (void);
 
@@ -39,6 +42,7 @@ do_prepare (int argc, char **argv)
   temp_fd = create_temp_file ("tst-preadvwritev.", &temp_filename);
   if (temp_fd == -1)
     FAIL_EXIT1 ("cannot create temporary file");
+  temp_fd_supports_holes = support_descriptor_supports_holes (temp_fd);
 }
 #define PREPARE do_prepare