[uClibc] [PATCH] Fix for compiling ioperm.c under Linux 2.0.x

Pavel Roskin proski at gnu.org
Tue Oct 21 16:46:20 UTC 2003


Hello!

Linux 2.0.x doesn't define CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE and
BUS_ISA_PORT_SHIFT.  Because of that, init_iosys() in
libc/sysdeps/linux/arm/ioperm.c cannot be compiled.  Later versions of
Linux use enum to define those symbols, so ifdef with them won't work -
LINUX_VERSION_CODE is needed.

The attached patch disables the uncompilable code on Linux older than
2.1.0.  It's just one of many methods to determine system type, so it
shouldn't be a big loss.

-- 
Regards,
Pavel Roskin
-------------- next part --------------
--- libc/sysdeps/linux/arm/ioperm.c
+++ libc/sysdeps/linux/arm/ioperm.c
@@ -100,6 +100,8 @@ init_iosys (void)
 {
     char systype[256];
     int i, n;
+
+#if LINUX_VERSION_CODE > 131328
     static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
     static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
     size_t len = sizeof(io.base);
@@ -109,6 +111,7 @@ init_iosys (void)
 	io.initdone = 1;
 	return 0;
     }
+#endif
 
     n = readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
     if (n > 0) {


More information about the uClibc mailing list