public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ports/3063] New: sysctl syscall used by ioperm() on arm
@ 2006-08-15 17:56 aurelien at aurel32 dot net
2010-03-23 14:54 ` [Bug ports/3063] " jsm28 at gcc dot gnu dot org
0 siblings, 1 reply; 3+ messages in thread
From: aurelien at aurel32 dot net @ 2006-08-15 17:56 UTC (permalink / raw)
To: glibc-bugs
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug ports/3063] sysctl syscall used by ioperm() on arm
2006-08-15 17:56 [Bug ports/3063] New: " aurelien at aurel32 dot net
@ 2010-03-23 14:54 ` jsm28 at gcc dot gnu dot org
0 siblings, 0 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2010-03-23 14:54 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From jsm28 at gcc dot gnu dot org 2010-03-23 14:53 -------
Is this change still desired (I haven't followed the details of kernel
development in this area)? If so, I can apply this patch (appropriately
updated to apply to current sources); unlike that posted to libc-ports
in November, this one is covered by a copyright assignment.
--
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-15 18:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-3063-131@http.sourceware.org/bugzilla/>
2012-02-15 17:55 ` [Bug ports/3063] sysctl syscall used by ioperm() on arm jsm28 at gcc dot gnu.org
2012-02-15 18:43 ` aurelien at aurel32 dot net
2006-08-15 17:56 [Bug ports/3063] New: " aurelien at aurel32 dot net
2010-03-23 14:54 ` [Bug ports/3063] " jsm28 at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).