mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH/RFC] Deprecate sysctl(2), add sysctl_name
Date: Fri, 11 Jul 2003 11:16:30 +0200	[thread overview]
Message-ID: <20030711091630.GA2707@wotan.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0307101932510.5551-100000@home.osdl.org>

On Thu, Jul 10, 2003 at 07:35:22PM -0700, Linus Torvalds wrote:
> 
> On Fri, 11 Jul 2003, Andi Kleen wrote:
> > 
> > This patch deprecates sysctl(2) by adding a printk to it. There is one
> > important user of it - glibc checks kernel.version in the startup code -
> > which is still handled without message. This needs to be still handled,
> > but the hope is that there are no other users of the numerical interface.
> 
> I'd prefer to first _only_ deprecate it, and if somebody really really 
> decides that they want another interface than /proc too, we can re-visit 
> the thing then.

Ok fine for me. Here is a new patch that only deprecates. 

> I doubt there is any real reason to not just use the /proc interface, and 
> I dislike pre-emptive engineering.

I don't feel particularly strongly about the sysctl_name thing, if you
think it's not necessary great.

-Andi

-------------

Deprecate numerical sysctl namespace. The only exception is kernel/version,
which is widely used in glibc. The new recommended interface is /proc/sys


--- linux-2.5/include/linux/sysctl.h	2003-06-06 17:55:40.000000000 +0200
+++ linux-2.5-amd64/include/linux/sysctl.h	2003-07-09 23:15:45.000000000 +0200
@@ -6,16 +6,10 @@
  ****************************************************************
  ****************************************************************
  **
- **  WARNING:  
  **  The values in this file are exported to user space via 
- **  the sysctl() binary interface.  Do *NOT* change the 
- **  numbering of any existing values here, and do not change
- **  any numbers within any one set of values.  If you have
- **  to redefine an existing interface, use a new number for it.
- **  The kernel will then return ENOTDIR to any application using
- **  the old binary interface.
- **
- **  --sct
+ **  the sysctl() binary interface.  However this interface
+ **  is unstable and deprecated and will be removed in the future. 
+ **  For a stable interface use /proc/sys.
  **
  ****************************************************************
  ****************************************************************
--- linux-2.5/kernel/sysctl.c	2003-07-04 23:52:20.000000000 +0200
+++ linux-2.5-amd64/kernel/sysctl.c	2003-07-11 03:25:18.000000000 +0200
@@ -823,7 +838,16 @@
 
 	if (copy_from_user(&tmp, args, sizeof(tmp)))
 		return -EFAULT;
-		
+	
+	if (tmp.nlen != 2 || tmp.name[0] != CTL_KERN ||
+	    tmp.name[1] != KERN_VERSION) { 
+		int i;
+		printk(KERN_INFO "%s: numerical sysctl ", current->comm); 
+		for (i = 0; i < tmp.nlen; i++) 
+			printk("%d ", tmp.name[i]); 
+		printk("is obsolete.\n");
+	} 
+
 	lock_kernel();
 	error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp,
 			  tmp.newval, tmp.newlen);

  parent reply	other threads:[~2003-07-11  9:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11  1:41 Andi Kleen
2003-07-11  2:35 ` Linus Torvalds
2003-07-11  3:24   ` Robert Love
2003-07-11  9:16   ` Andi Kleen [this message]
2003-07-11 10:09     ` Arjan van de Ven
2003-07-11 10:21       ` Andi Kleen
2003-07-12 20:09         ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030711091630.GA2707@wotan.suse.de \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®