glibc, starting with commit
glibc-2.24-28-gdbab657, has deprecated
inclusion of <sys/sysmacros.h> by <sys/types.h>. The method used
for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer
defines MAJOR_IN_SYSMACROS, which consequently breaks build.
Let's assume that all systems supported by strace provide major, minor,
and makedev macros via <sys/sysmacros.h>.
* configure.ac (AC_HEADER_MAJOR): Remove.
* mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove.
Include <sys/sysmacros.h> unconditionally.
* print_struct_stat.c: Likewise.
* tests/mknod.c: Likewise.
* tests/mknodat.c: Likewise.
* tests/xstatx.c: Likewise.
AC_TYPE_UID_T
AC_HEADER_DIRENT
-AC_HEADER_MAJOR
AC_HEADER_STAT
AC_HEADER_STDBOOL
AC_HEADER_STDC
#include <fcntl.h>
#include <sys/stat.h>
-
-#ifdef MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-#endif
-
-#ifdef MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-#endif
+#include <sys/sysmacros.h>
static void
decode_mknod(struct tcb *tcp, int offset)
#include "defs.h"
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include "stat.h"
-#if defined MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-#elif defined MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-#endif
void
print_struct_stat(struct tcb *tcp, const struct strace_stat *const st)
# include <stdio.h>
# include <sys/stat.h>
+# include <sys/sysmacros.h>
# include <unistd.h>
-# ifdef MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-# endif
-# ifdef MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-# endif
-
static const char sample[] = "mknod";
static long
# include <stdio.h>
# include <sys/stat.h>
+# include <sys/sysmacros.h>
# include <unistd.h>
-# ifdef MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-# endif
-# ifdef MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-# endif
-
static const char sample[] = "mknodat_sample";
static const long int fd = (long int) 0xdeadbeefffffffff;
# include <stddef.h>
# include <time.h>
# include <unistd.h>
-
-# if defined MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-# elif defined MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-# else
-# include <sys/types.h>
-# endif
+# include <sys/sysmacros.h>
static void
print_time(const time_t t)