explicit_bzero \
__fpending \
__fpurge \
- fallocate \
fpurge \
fnmatch \
fsconfig \
])
AC_FUNC_FSEEKO
+AC_CHECK_FUNCS([fallocate], [have_fallocate=yes], [have_fallocate=no])
AC_CHECK_FUNCS([futimens], [have_futimens=yes])
AC_CHECK_FUNCS([getusershell], [have_getusershell=yes],[have_getusershell=no])
AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes])
)
UL_BUILD_INIT([fallocate])
UL_REQUIRES_LINUX([fallocate])
-UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
+UL_REQUIRES_HAVE([fallocate], [fallocate], [fallocate functions])
AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes])
bashcompletions += ['mountpoint']
endif
-opt = not get_option('build-fallocate').disabled()
+opt = get_option('build-fallocate') \
+ .require(LINUX) \
+ .require(conf.get('HAVE_FALLOCATE').to_string() == '1') \
+ .allowed()
exe = executable(
'fallocate',
fallocate_sources,
#include <limits.h>
#include <string.h>
-#ifndef HAVE_FALLOCATE
-# include <sys/syscall.h>
-#endif
-
#if defined(HAVE_LINUX_FALLOC_H) && \
(!defined(FALLOC_FL_KEEP_SIZE) || !defined(FALLOC_FL_PUNCH_HOLE) || \
!defined(FALLOC_FL_COLLAPSE_RANGE) || !defined(FALLOC_FL_ZERO_RANGE) || \
{
int error;
-#ifdef HAVE_FALLOCATE
error = fallocate(fd, mode, offset, length);
-#else
- error = syscall(SYS_fallocate, fd, mode, offset, length);
-#endif
+
/*
* EOPNOTSUPP: The FALLOC_FL_KEEP_SIZE is unsupported
* ENOSYS: The filesystem does not support sys_fallocate