From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932560AbWGMGNL (ORCPT ); Thu, 13 Jul 2006 02:13:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932559AbWGMGNK (ORCPT ); Thu, 13 Jul 2006 02:13:10 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]:48881 "EHLO nf-out-0910.google.com") by vger.kernel.org with ESMTP id S932540AbWGMGNJ (ORCPT ); Thu, 13 Jul 2006 02:13:09 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RZBB/fEoZ9pY8YUATZJz5i10GG+kpjTvIRgxIaPkgyTRk/JrgAb8OKwE9hAYCrm3tP++2SvdEwxnMJLg5s/rWh1ekTyaHGZ9zg/zB7MmceYgoIvqJlsI5ojX86qsgsj66bA2saaXcv/gFb/KkDqs5zwGbLh2Ny8L6RnEVNMaJdQ= Message-ID: <787b0d920607122313u60a97698m2c4f75f93562d67d@mail.gmail.com> Date: Thu, 13 Jul 2006 02:13:07 -0400 From: "Albert Cahalan" To: "H. Peter Anvin" Subject: Re: [PATCH] Use uname not sysctl to get the kernel revision Cc: ak@suse.de, tytso@mit.edu, ebiederm@xmission.com, drepper@redhat.com, arjan@infradead.org, rdunlap@xenotime.net, akpm@osdl.org, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org In-Reply-To: <787b0d920607122309i364a3110re9907a947f907735@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <787b0d920607122200m4785f7ddmddf40c079a7460cb@mail.gmail.com> <44B5DD41.90705@zytor.com> <787b0d920607122309i364a3110re9907a947f907735@mail.gmail.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 7/13/06, Albert Cahalan wrote: > On 7/13/06, H. Peter Anvin wrote: > > Albert Cahalan wrote: > > >> > > >> The numerical namespace for sysctl is unsalvagable imho. e.g. > > >> distributions regularly break it because there is no central > > >> repository of numbers so it's not very usable anyways in practice. > > > > > > Huh? How exactly is this different from system call numbers, > > > ioctl numbers, fcntl numbers, ptrace command numbers, and every > > > other part of the Linux ABI? > > > > > > > Mostly because some branches of the sysctl tree have dynamic content > > which is hard to marshal into a numeric form. > > Dynamic content is no problem. FreeBSD uses sysctl > to implement their "ps" program. The process info comes > out of sysctl now. The sysctl man page has an example. > > Non-numeric data is more troublesome. FreeBSD has > a syscall that will take text (still faster than /proc/sys), > and another that will convert the text representation > into numeric form for later high-performance use. > > Look up all 3 calls here, in section 2: > http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+7.0-current Excuse me, it's in section 3. I don't know if they use a _sysctl like we do or what. Anyway, they claim that the numeric version is several times faster, so I don't think this is just a libc wrapper around /proc.