Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dd882794
Commit
dd882794
authored
Sep 14, 2021
by
Charles Davis
Committed by
Alexandre Julliard
Sep 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use posix_fallocate() instead of fallocate().
Signed-off-by:
Chip Davis
<
cdavis@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a45bb014
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
51 deletions
+11
-51
configure
configure
+1
-34
configure.ac
configure.ac
+1
-9
file.c
dlls/ntdll/unix/file.c
+6
-5
config.h.in
include/config.h.in
+3
-3
No files found.
configure
View file @
dd882794
...
...
@@ -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 <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_n
"checking for inline... "
>
&6
;
}
...
...
configure.ac
View file @
dd882794
...
...
@@ -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 <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 ****
AC_C_INLINE
...
...
dlls/ntdll/unix/file.c
View file @
dd882794
...
...
@@ -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
(
err
no
==
EOPNOTSUPP
)
WARN
(
"
fallocate not supported on this filesystem
\n
"
);
else
status
=
errno_to_status
(
err
no
);
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
);
...
...
include/config.h.in
View file @
dd882794
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment