Skip to content

Commit

Permalink
Add build check and use <sys/mkdev.h> for makedev() macro
Browse files Browse the repository at this point in the history
Fixes Solaris build issues. Kudos to Jarod for the help on this.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
  • Loading branch information
ColinIanKing committed Apr 3, 2024
1 parent 941ce32 commit a247911
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions core-vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ STRESS_PRAGMA_POP
#include <sys/sysmacros.h>
#endif

#if defined(HAVE_SYS_MKDEV_H)
#include <sys/mkdev.h>
#endif

#if defined(HAVE_SYS_VMMETER_H)
#include <sys/vmmeter.h>
#endif
Expand Down
12 changes: 4 additions & 8 deletions stress-sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,22 @@

#if defined(HAVE_LINUX_FS_H)
#include <linux/fs.h>
#else
UNEXPECTED
#endif

#if defined(HAVE_SYS_SYSMACROS_H)
#include <sys/sysmacros.h>
#else
UNEXPECTED
#endif

#if defined(HAVE_SYS_MKDEV_H)
#include <sys/mkdev.h>
#endif

#if defined(HAVE_SYS_STATFS_H)
#include <sys/statfs.h>
#else
UNEXPECTED
#endif

#if defined(HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#else
UNEXPECTED
#endif

static const stress_help_t help[] = {
Expand Down

0 comments on commit a247911

Please sign in to comment.