diff --git a/configure b/configure index 1adbf1789f3..4306ea70100 100755 --- a/configure +++ b/configure @@ -18008,6 +18008,7 @@ for ac_func in \ poll \ port_create \ posix_fadvise \ + posix_fallocate \ prctl \ proc_pidinfo \ readlink \ @@ -18600,40 +18601,6 @@ $as_echo "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fallocate" >&5 -$as_echo_n "checking for fallocate... " >&6; } -if ${wine_cv_have_fallocate+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _GNU_SOURCE -#include -int -main () -{ -fallocate(-1, 0, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - wine_cv_have_fallocate=yes -else - wine_cv_have_fallocate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_fallocate" >&5 -$as_echo "$wine_cv_have_fallocate" >&6; } -if test "$wine_cv_have_fallocate" = "yes" -then - -$as_echo "#define HAVE_FALLOCATE 1" >>confdefs.h - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } diff --git a/configure.ac b/configure.ac index eb970972936..6ca4eb5c923 100644 --- a/configure.ac +++ b/configure.ac @@ -2182,6 +2182,7 @@ AC_CHECK_FUNCS(\ poll \ port_create \ posix_fadvise \ + posix_fallocate \ prctl \ proc_pidinfo \ readlink \ @@ -2273,15 +2274,6 @@ then AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [Define to 1 if you have the `sched_setaffinity' function.]) fi -AC_CACHE_CHECK([for fallocate],wine_cv_have_fallocate, - AC_LINK_IFELSE([AC_LANG_PROGRAM( -[[#define _GNU_SOURCE -#include ]], [[fallocate(-1, 0, 0, 0);]])],[wine_cv_have_fallocate=yes],[wine_cv_have_fallocate=no])) -if test "$wine_cv_have_fallocate" = "yes" -then - AC_DEFINE(HAVE_FALLOCATE, 1, [Define to 1 if you have the `fallocate' function.]) -fi - dnl **** Check for types **** AC_C_INLINE diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index bcd74c9d6aa..e6f813966a5 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4494,14 +4494,15 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, status = STATUS_INVALID_PARAMETER; else { -#ifdef HAVE_FALLOCATE - if (fallocate( fd, 0, 0, (off_t)info->ValidDataLength.QuadPart ) == -1) +#ifdef HAVE_POSIX_FALLOCATE + int err; + if ((err = posix_fallocate( fd, 0, (off_t)info->ValidDataLength.QuadPart )) != 0) { - if (errno == EOPNOTSUPP) WARN( "fallocate not supported on this filesystem\n" ); - else status = errno_to_status( errno ); + if (err == EOPNOTSUPP) WARN( "posix_fallocate not supported on this filesystem\n" ); + else status = errno_to_status( err ); } #else - FIXME( "setting valid data length not supported\n" ); + WARN( "setting valid data length not supported\n" ); #endif } if (needs_close) close( fd ); diff --git a/include/config.h.in b/include/config.h.in index 9f8e7f34ada..f66444fd715 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -83,9 +83,6 @@ /* Define to 1 if you have the `F3DAudioInitialize8' function. */ #undef HAVE_F3DAUDIOINITIALIZE8 -/* Define to 1 if you have the `fallocate' function. */ -#undef HAVE_FALLOCATE - /* Define to 1 if you have the `FAudioCreateReverb9WithCustomAllocatorEXT' function. */ #undef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT @@ -507,6 +504,9 @@ /* Define to 1 if you have the `posix_fadvise' function. */ #undef HAVE_POSIX_FADVISE +/* Define to 1 if you have the `posix_fallocate' function. */ +#undef HAVE_POSIX_FALLOCATE + /* Define to 1 if you have the `prctl' function. */ #undef HAVE_PRCTL