Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
69f1b12a
Commit
69f1b12a
authored
Jul 09, 2020
by
Evgeny Litvinenko
Committed by
Alexandre Julliard
Aug 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add check for totalram, mem_unit in struct sysinfo.
Signed-off-by:
Evgeny Litvinenko
<
evgeny.v.litvinenko@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
124cd264
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
8 deletions
+53
-8
configure
configure
+26
-0
configure.ac
configure.ac
+6
-0
virtual.c
dlls/ntdll/unix/virtual.c
+15
-8
config.h.in
include/config.h.in
+6
-0
No files found.
configure
View file @
69f1b12a
...
...
@@ -19643,6 +19643,32 @@ _ACEOF
fi
ac_fn_c_check_member
"
$LINENO
"
"struct sysinfo"
"totalram"
"ac_cv_member_struct_sysinfo_totalram"
"#ifdef HAVE_SYS_SYSINFO_H
# include <sys/sysinfo.h>
#endif
"
if
test
"x
$ac_cv_member_struct_sysinfo_totalram
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_STRUCT_SYSINFO_TOTALRAM 1
_ACEOF
fi
ac_fn_c_check_member
"
$LINENO
"
"struct sysinfo"
"mem_unit"
"ac_cv_member_struct_sysinfo_mem_unit"
"#ifdef HAVE_SYS_SYSINFO_H
# include <sys/sysinfo.h>
#endif
"
if
test
"x
$ac_cv_member_struct_sysinfo_mem_unit
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_STRUCT_SYSINFO_MEM_UNIT 1
_ACEOF
fi
ac_save_LIBS
=
"
$LIBS
"
LIBS
=
"
$LIBS
-lm"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for isfinite"
>
&5
...
...
configure.ac
View file @
69f1b12a
...
...
@@ -2658,6 +2658,12 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr],,,
# include <net/if.h>
#endif])
dnl Check for struct sysinfo members totalram and mem_unit
AC_CHECK_MEMBERS([struct sysinfo.totalram, struct sysinfo.mem_unit],,,
[#ifdef HAVE_SYS_SYSINFO_H
# include <sys/sysinfo.h>
#endif])
dnl Check for isfinite
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lm"
...
...
dlls/ntdll/unix/virtual.c
View file @
69f1b12a
...
...
@@ -43,6 +43,9 @@
#ifdef HAVE_SYS_SYSINFO_H
# include <sys/sysinfo.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
#endif
...
...
@@ -2481,22 +2484,26 @@ ULONG_PTR get_system_affinity_mask(void)
*/
void
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
)
{
#if
def HAVE_SYSINFO
#if
defined(HAVE_STRUCT_SYSINFO_TOTALRAM) && defined(HAVE_STRUCT_SYSINFO_MEM_UNIT)
struct
sysinfo
sinfo
;
#endif
info
->
unknown
=
0
;
info
->
KeMaximumIncrement
=
0
;
/* FIXME */
info
->
PageSize
=
page_size
;
info
->
MmLowestPhysicalPage
=
1
;
info
->
MmHighestPhysicalPage
=
0x7fffffff
/
page_size
;
#ifdef HAVE_SYSINFO
if
(
!
sysinfo
(
&
sinfo
))
{
ULONG64
total
=
(
ULONG64
)
sinfo
.
totalram
*
sinfo
.
mem_unit
;
info
->
MmHighestPhysicalPage
=
max
(
1
,
total
/
page_size
);
}
#elif defined(_SC_PHYS_PAGES)
LONG64
phys_pages
=
sysconf
(
_SC_PHYS_PAGES
);
info
->
MmHighestPhysicalPage
=
max
(
1
,
phys_pages
);
#else
info
->
MmHighestPhysicalPage
=
0x7fffffff
/
page_size
;
#endif
info
->
unknown
=
0
;
info
->
KeMaximumIncrement
=
0
;
/* FIXME */
info
->
PageSize
=
page_size
;
info
->
MmLowestPhysicalPage
=
1
;
info
->
MmNumberOfPhysicalPages
=
info
->
MmHighestPhysicalPage
-
info
->
MmLowestPhysicalPage
;
info
->
AllocationGranularity
=
granularity_mask
+
1
;
info
->
LowestUserAddress
=
(
void
*
)
0x10000
;
...
...
include/config.h.in
View file @
69f1b12a
...
...
@@ -950,6 +950,12 @@
/* Define to 1 if `__st_birthtime' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT___ST_BIRTHTIME
/* Define to 1 if `mem_unit' is a member of `struct sysinfo'. */
#undef HAVE_STRUCT_SYSINFO_MEM_UNIT
/* Define to 1 if `totalram' is a member of `struct sysinfo'. */
#undef HAVE_STRUCT_SYSINFO_TOTALRAM
/* Define to 1 if `tcps_connattempt' is a member of `struct tcpstat'. */
#undef HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT
...
...
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