From: Julian Seward Date: Thu, 13 Jun 2002 16:07:51 +0000 (+0000) Subject: Remove inclusion of and since that X-Git-Tag: svn/VALGRIND_1_0_3~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8417ae82b5055eb95b5ef0878b478bae56acc427;p=thirdparty%2Fvalgrind.git Remove inclusion of and since that seems to lead to a portability swamp. As a result, remove autoconf check for . Replace all this junk with VKI_SIZEOF_STRUCT_MODULE (== 96) since that's all I ever wanted to know in the first place. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@413 --- diff --git a/configure.in b/configure.in index 4d8b9ec510..091b4cebd7 100644 --- a/configure.in +++ b/configure.in @@ -262,7 +262,7 @@ AC_SUBST(PREFERRED_STACK_BOUNDARY) # 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 diff --git a/coregrind/vg_kerneliface.h b/coregrind/vg_kerneliface.h index 8eb7046306..ef6cd6677d 100644 --- a/coregrind/vg_kerneliface.h +++ b/coregrind/vg_kerneliface.h @@ -326,6 +326,24 @@ struct vki_stat { #define VKI_AT_PHDR 3 /* program headers for program */ +/* Including leads to loads of hassle because then we + need 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 + #include + #include + + 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 */ diff --git a/coregrind/vg_unsafe.h b/coregrind/vg_unsafe.h index cd9f3cd740..0f726468d0 100644 --- a/coregrind/vg_unsafe.h +++ b/coregrind/vg_unsafe.h @@ -50,10 +50,6 @@ #include /* for struct sembuf */ #include /* for ISDN ioctls */ -#ifdef HAVE_ASM_ATOMIC_H -#include /* necessary for module.h */ -#endif -#include /* for struct module */ #include /* for the SG_* ioctls */ #include /* for struct sched_param */ #include /* for struct __sysctl_args */ diff --git a/vg_kerneliface.h b/vg_kerneliface.h index 8eb7046306..ef6cd6677d 100644 --- a/vg_kerneliface.h +++ b/vg_kerneliface.h @@ -326,6 +326,24 @@ struct vki_stat { #define VKI_AT_PHDR 3 /* program headers for program */ +/* Including leads to loads of hassle because then we + need 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 + #include + #include + + 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 */ diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c index 5fc3cc7dda..e228f8ad7a 100644 --- a/vg_syscall_mem.c +++ b/vg_syscall_mem.c @@ -871,7 +871,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) 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; diff --git a/vg_unsafe.h b/vg_unsafe.h index cd9f3cd740..0f726468d0 100644 --- a/vg_unsafe.h +++ b/vg_unsafe.h @@ -50,10 +50,6 @@ #include /* for struct sembuf */ #include /* for ISDN ioctls */ -#ifdef HAVE_ASM_ATOMIC_H -#include /* necessary for module.h */ -#endif -#include /* for struct module */ #include /* for the SG_* ioctls */ #include /* for struct sched_param */ #include /* for struct __sysctl_args */