ntdll: Use posix_fallocate() instead of fallocate().
Signed-off-by: Chip Davis <cdavis@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a45bb014e8
commit
dd882794d2
|
@ -18008,6 +18008,7 @@ for ac_func in \
|
||||||
poll \
|
poll \
|
||||||
port_create \
|
port_create \
|
||||||
posix_fadvise \
|
posix_fadvise \
|
||||||
|
posix_fallocate \
|
||||||
prctl \
|
prctl \
|
||||||
proc_pidinfo \
|
proc_pidinfo \
|
||||||
readlink \
|
readlink \
|
||||||
|
@ -18600,40 +18601,6 @@ $as_echo "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h
|
||||||
|
|
||||||
fi
|
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 <fcntl.h>
|
|
||||||
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 "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
|
||||||
$as_echo_n "checking for inline... " >&6; }
|
$as_echo_n "checking for inline... " >&6; }
|
||||||
|
|
10
configure.ac
10
configure.ac
|
@ -2182,6 +2182,7 @@ AC_CHECK_FUNCS(\
|
||||||
poll \
|
poll \
|
||||||
port_create \
|
port_create \
|
||||||
posix_fadvise \
|
posix_fadvise \
|
||||||
|
posix_fallocate \
|
||||||
prctl \
|
prctl \
|
||||||
proc_pidinfo \
|
proc_pidinfo \
|
||||||
readlink \
|
readlink \
|
||||||
|
@ -2273,15 +2274,6 @@ then
|
||||||
AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [Define to 1 if you have the `sched_setaffinity' function.])
|
AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [Define to 1 if you have the `sched_setaffinity' function.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CACHE_CHECK([for fallocate],wine_cv_have_fallocate,
|
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
|
||||||
[[#define _GNU_SOURCE
|
|
||||||
#include <fcntl.h>]], [[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 ****
|
dnl **** Check for types ****
|
||||||
|
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
|
|
@ -4494,14 +4494,15 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||||
status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FALLOCATE
|
#ifdef HAVE_POSIX_FALLOCATE
|
||||||
if (fallocate( fd, 0, 0, (off_t)info->ValidDataLength.QuadPart ) == -1)
|
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" );
|
if (err == EOPNOTSUPP) WARN( "posix_fallocate not supported on this filesystem\n" );
|
||||||
else status = errno_to_status( errno );
|
else status = errno_to_status( err );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
FIXME( "setting valid data length not supported\n" );
|
WARN( "setting valid data length not supported\n" );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (needs_close) close( fd );
|
if (needs_close) close( fd );
|
||||||
|
|
|
@ -83,9 +83,6 @@
|
||||||
/* Define to 1 if you have the `F3DAudioInitialize8' function. */
|
/* Define to 1 if you have the `F3DAudioInitialize8' function. */
|
||||||
#undef HAVE_F3DAUDIOINITIALIZE8
|
#undef HAVE_F3DAUDIOINITIALIZE8
|
||||||
|
|
||||||
/* Define to 1 if you have the `fallocate' function. */
|
|
||||||
#undef HAVE_FALLOCATE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `FAudioCreateReverb9WithCustomAllocatorEXT'
|
/* Define to 1 if you have the `FAudioCreateReverb9WithCustomAllocatorEXT'
|
||||||
function. */
|
function. */
|
||||||
#undef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT
|
#undef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT
|
||||||
|
@ -507,6 +504,9 @@
|
||||||
/* Define to 1 if you have the `posix_fadvise' function. */
|
/* Define to 1 if you have the `posix_fadvise' function. */
|
||||||
#undef HAVE_POSIX_FADVISE
|
#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. */
|
/* Define to 1 if you have the `prctl' function. */
|
||||||
#undef HAVE_PRCTL
|
#undef HAVE_PRCTL
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue