Consolidate fallocate{64} implementations
[platform/upstream/glibc.git] / sysdeps / unix / sysv / linux / tst-fallocate.c
similarity index 63%
rename from sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
rename to sysdeps/unix/sysv/linux/tst-fallocate.c
index c1dd0b4..ec3867c 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Basic fallocate test (no specific flags is checked).
+   Copyright (C) 2016 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
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep-cancel.h>
+#include "tst-fallocate-common.c"
 
-
-/* Reserve storage for the data of the file associated with FD.  */
-int
-fallocate (int fd, int mode, __off_t offset, __off_t len)
+static int
+do_test (void)
 {
-#ifdef __NR_fallocate
-  return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
-#else
-  __set_errno (ENOSYS);
-  return -1;
-#endif
+  return do_test_with_offset (0);
 }
-strong_alias (fallocate, fallocate64)