From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32759 invoked by alias); 15 Aug 2006 17:56:32 -0000 Received: (qmail 32682 invoked by uid 48); 15 Aug 2006 17:56:23 -0000 Date: Tue, 15 Aug 2006 17:56:00 -0000 From: "aurelien at aurel32 dot net" To: glibc-bugs@sources.redhat.com Message-ID: <20060815175622.3063.aurelien@aurel32.net> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug ports/3063] New: sysctl syscall used by ioperm() on arm X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00134.txt.bz2 List-Id: The sysctl syscall has been removed in 2.6.18+ kernels and replaced by a dummy syscall returning an error. Therefore sysctl() could not be used anymore. This function is used on ioperm() on arm. The values should be read from /proc instead. You will find a patch below to fix the problem. --- libc/sysdeps/unix/sysv/linux/arm/ioperm.c.orig 2006-08-15 18:23:08.715868260 +0200 +++ libc/sysdeps/unix/sysv/linux/arm/ioperm.c 2006-08-15 19:30:07.215439365 +0200 @@ -49,6 +49,8 @@ #define PATH_ARM_SYSTYPE "/etc/arm_systype" #define PATH_CPUINFO "/proc/cpuinfo" +#define PATH_PORTBASE "/proc/bus/isa/portbase" +#define PATH_PORTSHIFT "/proc/bus/isa/portshift" #define MAX_PORT 0x10000 @@ -100,15 +102,25 @@ { char systype[256]; int i, n; - static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE }; - static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT }; + FILE * fp; + size_t len = sizeof(io.base); - if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) - && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0)) + if (fp = fopen (PATH_PORTBASE, "r")) { - io.initdone = 1; - return 0; + n = fscanf (fp, "%li", &io.io_base); + fclose(fp); + + if (n == 1 && (fp = fopen(PATH_PORTSHIFT, "r"))) + { + n = fscanf (fp, "%i", &io.io_shift); + fclose(fp); + if (n == 1) + { + io.initdone = 1; + return 0; + } + } } n = readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1); @@ -127,8 +139,6 @@ } else { - FILE * fp; - fp = fopen (PATH_CPUINFO, "r"); if (! fp) return -1; -- Summary: sysctl syscall used by ioperm() on arm Product: glibc Version: 2.4 Status: NEW Severity: normal Priority: P2 Component: ports AssignedTo: roland at gnu dot org ReportedBy: aurelien at aurel32 dot net CC: glibc-bugs at sources dot redhat dot com GCC build triplet: armv-unknown-linux-gnu GCC host triplet: arm-unknown-linux-gnu GCC target triplet: arm-unknown-linux-gnu http://sourceware.org/bugzilla/show_bug.cgi?id=3063 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.