aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/tst-preadvwritev-common.c4
-rw-r--r--misc/tst-preadvwritev64.c6
2 files changed, 10 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
diff --git a/misc/tst-preadvwritev64.c b/misc/tst-preadvwritev64.c
index b718da6be5..451d03e4a8 100644
--- a/misc/tst-preadvwritev64.c
+++ b/misc/tst-preadvwritev64.c
@@ -26,6 +26,12 @@ do_test (void)
ret = do_test_with_offset (0);
+ if (!temp_fd_supports_holes)
+ {
+ puts ("warning: partial test due to lack of support for holes");
+ return ret;
+ }
+
/* 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 + 2048LL;