]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - io/tst-copy_file_range.c
nss_dns: Remove RES_USE_INET6 handling
[thirdparty/glibc.git] / io / tst-copy_file_range.c
index f1cab1252d39ba1dadffe18dc7b59611e1dec930..a5dcf3c1f62eaf829ad1ee698bb7a1fc5d1962a7 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests for copy_file_range.
-   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   Copyright (C) 2017-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,9 @@
 #include <support/temp_file.h>
 #include <support/test-driver.h>
 #include <support/xunistd.h>
-#include <sys/mount.h>
+#ifdef CLONE_NEWNS
+# include <sys/mount.h>
+#endif
 
 /* Boolean flags which indicate whether to use pointers with explicit
    output flags.  */
@@ -737,7 +739,12 @@ do_test (void)
     *p = rand () >> 24;
 
   infd = create_temp_file ("tst-copy_file_range-in-", &infile);
-  xclose (create_temp_file ("tst-copy_file_range-out-", &outfile));
+  {
+    int outfd = create_temp_file ("tst-copy_file_range-out-", &outfile);
+    if (!support_descriptor_supports_holes (outfd))
+      FAIL_UNSUPPORTED ("File %s does not support holes", outfile);
+    xclose (outfd);
+  }
 
   /* Try to find a different directory from the default input/output
      file.  */