[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r1722 - in glibc-package/trunk/debian: . patches patches/any



Author: aurel32
Date: 2006-08-14 21:14:10 +0000 (Mon, 14 Aug 2006)
New Revision: 1722

Added:
   glibc-package/trunk/debian/patches/any/local-sysctl.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
 * New any/local-sysctl.diff patch to remove the annoying warning messages
   that appear with 2.6.18+ kernels, and to warn users to not use sysctl().


Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2006-08-14 13:08:34 UTC (rev 1721)
+++ glibc-package/trunk/debian/changelog	2006-08-14 21:14:10 UTC (rev 1722)
@@ -15,6 +15,8 @@
   [ Aurelien Jarno ]
   * sysdeps/{powerpc,s390,ia64}.mk: make the NPTL version buildable on 2.4
     kernels.
+  * New any/local-sysctl.diff patch to remove the annoying warning messages
+    that appear with 2.6.18+ kernels, and to warn users to not use sysctl().
 
  -- Aurelien Jarno <aurel32@debian.org>  Thu, 10 Aug 2006 21:23:07 +0200
 

Added: glibc-package/trunk/debian/patches/any/local-sysctl.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/local-sysctl.diff	2006-08-14 13:08:34 UTC (rev 1721)
+++ glibc-package/trunk/debian/patches/any/local-sysctl.diff	2006-08-14 21:14:10 UTC (rev 1722)
@@ -0,0 +1,78 @@
+diff -Nurd glibc-2.3.6.orig/linuxthreads/sysdeps/unix/sysv/linux/smp.h glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/smp.h
+--- glibc-2.3.6.orig/linuxthreads/sysdeps/unix/sysv/linux/smp.h	2002-09-08 22:37:11.000000000 +0200
++++ glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/smp.h	2006-08-14 21:59:40.527190466 +0200
+@@ -25,24 +25,17 @@
+ static inline int
+ is_smp_system (void)
+ {
+-  static const int sysctl_args[] = { CTL_KERN, KERN_VERSION };
+   char buf[512];
+   size_t reslen = sizeof (buf);
+ 
+-  /* Try reading the number using `sysctl' first.  */
+-  if (__sysctl ((int *) sysctl_args,
+-		sizeof (sysctl_args) / sizeof (sysctl_args[0]),
+-		buf, &reslen, NULL, 0) < 0)
+-    {
+-      /* This was not successful.  Now try reading the /proc filesystem.  */
+-      int fd = __open ("/proc/sys/kernel/version", O_RDONLY);
+-      if (__builtin_expect (fd, 0) == -1
+-	  || (reslen = __read (fd, buf, sizeof (buf))) <= 0)
+-	/* This also didn't work.  We give up and say it's a UP machine.  */
+-	buf[0] = '\0';
++  /* Try reading the /proc filesystem first.  */
++  int fd = __open ("/proc/sys/kernel/version", O_RDONLY);
++  if (__builtin_expect (fd, 0) == -1
++      || (reslen = __read (fd, buf, sizeof (buf))) <= 0)
++    /* This didn't work.  We give up and say it's a UP machine.  */
++    buf[0] = '\0';
+ 
+-      __close (fd);
+-    }
++   __close (fd);
+ 
+   return strstr (buf, "SMP") != NULL;
+ }
+diff -Nurd glibc-2.3.6.orig/nptl/sysdeps/unix/sysv/linux/smp.h glibc-2.3.6/nptl/sysdeps/unix/sysv/linux/smp.h
+--- glibc-2.3.6.orig/nptl/sysdeps/unix/sysv/linux/smp.h	2004-11-03 21:31:12.000000000 +0100
++++ glibc-2.3.6/nptl/sysdeps/unix/sysv/linux/smp.h	2006-08-14 21:57:52.353875675 +0200
+@@ -29,24 +29,17 @@
+ static inline int
+ is_smp_system (void)
+ {
+-  static const int sysctl_args[] = { CTL_KERN, KERN_VERSION };
+   char buf[512];
+   size_t reslen = sizeof (buf);
+ 
+-  /* Try reading the number using `sysctl' first.  */
+-  if (__sysctl ((int *) sysctl_args,
+-		sizeof (sysctl_args) / sizeof (sysctl_args[0]),
+-		buf, &reslen, NULL, 0) < 0)
+-    {
+-      /* This was not successful.  Now try reading the /proc filesystem.  */
+-      int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
+-      if (__builtin_expect (fd, 0) == -1
+-	  || (reslen = read_not_cancel (fd, buf, sizeof (buf))) <= 0)
+-	/* This also didn't work.  We give up and say it's a UP machine.  */
+-	buf[0] = '\0';
++  /* Try reading the /proc filesystem first.  */
++  int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
++  if (__builtin_expect (fd, 0) == -1
++      || (reslen = read_not_cancel (fd, buf, sizeof (buf))) <= 0)
++    /* This didn't work.  We give up and say it's a UP machine.  */
++    buf[0] = '\0';
+ 
+-      close_not_cancel_no_status (fd);
+-    }
++  close_not_cancel_no_status (fd);
+ 
+   return strstr (buf, "SMP") != NULL;
+ }
+diff -Nurd glibc-2.3.6.orig/sysdeps/unix/sysv/linux/sysctl.c glibc-2.3.6/sysdeps/unix/sysv/linux/sysctl.c
+--- glibc-2.3.6.orig/sysdeps/unix/sysv/linux/sysctl.c	2005-07-18 05:37:20.000000000 +0200
++++ glibc-2.3.6/sysdeps/unix/sysv/linux/sysctl.c	2006-08-14 22:12:28.454345256 +0200
+@@ -47,3 +47,4 @@
+ }
+ libc_hidden_def (__sysctl)
+ weak_alias (__sysctl, sysctl)
++link_warning (__sysctl, "the `sysctl' syscall has been removed from 2.6.18+ kernels, direct access to `/proc/sys' should be used instead.")

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series	2006-08-14 13:08:34 UTC (rev 1721)
+++ glibc-package/trunk/debian/patches/series	2006-08-14 21:14:10 UTC (rev 1722)
@@ -165,6 +165,7 @@
 any/local-makeconfig.diff -p0
 any/local-nss-upgrade.diff -p1
 any/local-rtld.diff -p1
+any/local-sysctl.diff -p1
 any/local-tcsetaddr.diff -p1
 any/local-ttyname-devfs.diff -p0
 any/local-version-sanity.diff -p1



Reply to: