# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h termios.h unistd.h utime.h asm/atomic.h])
+AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h termios.h unistd.h utime.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
#define VKI_AT_PHDR 3 /* program headers for program */
+/* Including <linux/module.h> leads to loads of hassle because then we
+ need <asm/atomic.h> sometimes (RedHat 7.3) and that is a
+ kernel-only header which deliberately #errors on gcc-3.1. Mucho
+ hassle considering that we only want to know sizeof(struct module).
+ Hence ...
+
+ #include <stdio.h>
+ #include <asm/atomic.h>
+ #include <linux/module.h>
+
+ int main ( void )
+ {
+ printf ("sizeof(struct module) = %d\n", sizeof(struct module) );
+ return 0;
+ }
+*/
+
+#define VKI_SIZEOF_STRUCT_MODULE 96
#endif /* ndef __VG_KERNELIFACE_H */
#include <linux/sem.h> /* for struct sembuf */
#include <linux/isdn.h> /* for ISDN ioctls */
-#ifdef HAVE_ASM_ATOMIC_H
-#include <asm/atomic.h> /* necessary for module.h */
-#endif
-#include <linux/module.h> /* for struct module */
#include <scsi/sg.h> /* for the SG_* ioctls */
#include <sched.h> /* for struct sched_param */
#include <linux/sysctl.h> /* for struct __sysctl_args */
#define VKI_AT_PHDR 3 /* program headers for program */
+/* Including <linux/module.h> leads to loads of hassle because then we
+ need <asm/atomic.h> sometimes (RedHat 7.3) and that is a
+ kernel-only header which deliberately #errors on gcc-3.1. Mucho
+ hassle considering that we only want to know sizeof(struct module).
+ Hence ...
+
+ #include <stdio.h>
+ #include <asm/atomic.h>
+ #include <linux/module.h>
+
+ int main ( void )
+ {
+ printf ("sizeof(struct module) = %d\n", sizeof(struct module) );
+ return 0;
+ }
+*/
+
+#define VKI_SIZEOF_STRUCT_MODULE 96
#endif /* ndef __VG_KERNELIFACE_H */
VG_(printf)("init_module ( %p, %p )\n", arg1, arg2 );
must_be_readable_asciiz( tst, "init_module(name)", arg1 );
must_be_readable( tst, "init_module(image)", arg2,
- sizeof(struct module) );
+ VKI_SIZEOF_STRUCT_MODULE );
KERNEL_DO_SYSCALL(tid,res);
break;
#include <linux/sem.h> /* for struct sembuf */
#include <linux/isdn.h> /* for ISDN ioctls */
-#ifdef HAVE_ASM_ATOMIC_H
-#include <asm/atomic.h> /* necessary for module.h */
-#endif
-#include <linux/module.h> /* for struct module */
#include <scsi/sg.h> /* for the SG_* ioctls */
#include <sched.h> /* for struct sched_param */
#include <linux/sysctl.h> /* for struct __sysctl_args */