ntdll: Only use sysinfo function when present.

On some systems <sys/sysinfo.h> may be present while the sysinfo
function may not, or at least not as part of standard libraries,
so check whether the function is actually available before using
it.

This fixes builds on FreeBSD with the devel/libsysinfo present.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 59da79021a)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Gerald Pfeifer 2021-08-10 22:36:27 +02:00 committed by Michael Stefaniuc
parent 97bbaf5285
commit b363adda05
4 changed files with 7 additions and 1 deletions

1
configure vendored
View File

@ -17760,6 +17760,7 @@ for ac_func in \
setprogname \
sigprocmask \
symlink \
sysinfo \
tcdrain \
thr_kill2

View File

@ -2160,6 +2160,7 @@ AC_CHECK_FUNCS(\
setprogname \
sigprocmask \
symlink \
sysinfo \
tcdrain \
thr_kill2
)

View File

@ -2451,7 +2451,8 @@ ULONG_PTR get_system_affinity_mask(void)
*/
void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info )
{
#if defined(HAVE_STRUCT_SYSINFO_TOTALRAM) && defined(HAVE_STRUCT_SYSINFO_MEM_UNIT)
#if defined(HAVE_SYSINFO) \
&& defined(HAVE_STRUCT_SYSINFO_TOTALRAM) && defined(HAVE_STRUCT_SYSINFO_MEM_UNIT)
struct sysinfo sinfo;
if (!sysinfo(&sinfo))

View File

@ -891,6 +891,9 @@
/* Define to 1 if you have the <syscall.h> header file. */
#undef HAVE_SYSCALL_H
/* Define to 1 if you have the `sysinfo' function. */
#undef HAVE_SYSINFO
/* Define to 1 if you have the
<SystemConfiguration/SCDynamicStoreCopyDHCPInfo.h> header file. */
#undef HAVE_SYSTEMCONFIGURATION_SCDYNAMICSTORECOPYDHCPINFO_H