--- ./sysdeps/unix/sysv/linux/dl-osinfo.h.orig 2004-12-16 21:31:50.000000000 -0600 +++ ./sysdeps/unix/sysv/linux/dl-osinfo.h 2006-08-21 23:00:49.000000000 -0500 @@ -53,6 +53,9 @@ int parts; \ char *cp; \ struct utsname uts; \ + int dotsfound = 0; \ + int versionindex = 0; \ + char *choppoint; \ \ /* Try the uname syscall */ \ if (__uname (&uts)) \ @@ -72,8 +75,34 @@ else \ buf = uts.release; \ \ + /* We are only interested in the first three kernel numbers, so */ \ + /* chop off anything past that: */ \ + \ + choppoint = buf; \ + while (1) \ + { \ + versionindex++; \ + if (versionindex == 63) break; \ + if (*choppoint == '.') dotsfound++; \ + choppoint++; \ + if (dotsfound == 2) \ + { \ + if (*choppoint == '0' || *choppoint == '1' \ + || *choppoint == '2' || *choppoint == '3' \ + || *choppoint == '4' || *choppoint == '5' \ + || *choppoint == '6' || *choppoint == '7' \ + || *choppoint == '8' || *choppoint == '9') \ + continue; \ + else \ + { \ + *choppoint = 0; \ + break; \ + } \ + } \ + } \ + \ /* Now convert it into a number. The string consists of at most \ - three parts. */ \ + three parts. Now it does, anyway. ;-) */ \ version = 0; \ parts = 0; \ cp = buf; \