From a247911432687f6592b73f5fb0242ff7530d0ab3 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 3 Apr 2024 09:49:24 +0100 Subject: [PATCH] Add build check and use for makedev() macro Fixes Solaris build issues. Kudos to Jarod for the help on this. Signed-off-by: Colin Ian King --- Makefile.config | 4 ++++ core-vmstat.c | 4 ++++ stress-sysinfo.c | 12 ++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile.config b/Makefile.config index e7826301e..02036fb83 100644 --- a/Makefile.config +++ b/Makefile.config @@ -562,6 +562,7 @@ headers: \ SYS_IPC_H \ SYS_LOADAVG_H \ SYSLOG_H \ + SYS_MKDEV_H \ SYS_MOUNT_H \ SYS_MSG_H \ SYS_PARAM_H \ @@ -988,6 +989,9 @@ SYS_IPC_H: SYS_LOADAVG_H: $(call check_header,sys/loadavg.h,HAVE_SYS_LOADAVG_H) +SYS_MKDEV_H: + $(call check_header,sys/mkdev.h,HAVE_SYS_MKDEV_H) + SYS_MOUNT_H: $(call check_header,sys/mount.h,HAVE_SYS_MOUNT_H) diff --git a/core-vmstat.c b/core-vmstat.c index 60b1c6d66..f49e46b6b 100644 --- a/core-vmstat.c +++ b/core-vmstat.c @@ -51,6 +51,10 @@ STRESS_PRAGMA_POP #include #endif +#if defined(HAVE_SYS_MKDEV_H) +#include +#endif + #if defined(HAVE_SYS_VMMETER_H) #include #endif diff --git a/stress-sysinfo.c b/stress-sysinfo.c index d684a26bf..423f9ba5c 100644 --- a/stress-sysinfo.c +++ b/stress-sysinfo.c @@ -23,26 +23,22 @@ #if defined(HAVE_LINUX_FS_H) #include -#else -UNEXPECTED #endif #if defined(HAVE_SYS_SYSMACROS_H) #include -#else -UNEXPECTED +#endif + +#if defined(HAVE_SYS_MKDEV_H) +#include #endif #if defined(HAVE_SYS_STATFS_H) #include -#else -UNEXPECTED #endif #if defined(HAVE_SYS_STATVFS_H) #include -#else -UNEXPECTED #endif static const stress_help_t help[] = {