From owner-freebsd-questions@FreeBSD.ORG Wed Oct 5 18:54:37 2011 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70260106566C for ; Wed, 5 Oct 2011 18:54:37 +0000 (UTC) (envelope-from jau@jau.iki.fi) Received: from jau.iki.fi (ip193-64-26-117.cust.eunet.fi [193.64.26.117]) by mx1.freebsd.org (Postfix) with ESMTP id D2D1D8FC0A for ; Wed, 5 Oct 2011 18:54:35 +0000 (UTC) Received: from jau.iki.fi (localhost [127.0.0.1]) by jau.iki.fi (8.14.5/8.14.5) with ESMTP id p95IsXVF028002 for ; Wed, 5 Oct 2011 21:54:33 +0300 (EEST) (envelope-from jau@jau.iki.fi) Received: (from jau@localhost) by jau.iki.fi (8.14.5/8.14.5/Submit) id p95IsXbr028001 for questions@freebsd.org; Wed, 5 Oct 2011 21:54:33 +0300 (EEST) (envelope-from jau) Message-Id: <201110051854.p95IsXbr028001@jau.iki.fi> To: questions@freebsd.org Date: Wed, 5 Oct 2011 21:54:33 +0300 (EEST) From: jau@iki.fi (Jukka A. Ukkonen) Sender: jau@iki.fi Latin-Date: dies Mercurii V Octombrie a.d. MMXI Organization: Private person OS-Platform: FreeBSD Phone: +358-9-6215280 (home) / +358-500-606671 (gsm) Content-Conversion: prohibited X-Mailer: ELM [version 2.4 PL25+pgp] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (jau.iki.fi [127.0.0.1]); Wed, 05 Oct 2011 21:54:34 +0300 (EEST) Cc: Subject: A couple of new sysctl variables - maybe? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jau@iki.fi List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2011 18:54:37 -0000 Greetings all, Having been working with various other UNIX variants as well it just occurred to me that in FreeBSD we do not have any simple method for retrieving either the hardware word length (memory bus width) or the kernel's basic word length. Usually these two are of course the same thing, but it is more a best practice convention than an absolute necessity. Anyhow on other systems like SunOS/Solaris there is "isainfo -b" and on Linux there is "getconf LONG_BIT" or something to check how many bits there are in the system's default word. Something similar would be nice in FreeBSD as well, though, I think the natural place for retrieving such a value would most likely be using sysctl. Maybe it would be OK to add two new entries to the sysctl tree: "hw.wordbits" and "kern.wordbits", or something similar to the basic sysctl variables. The value should be just one constant number, usually 32 or 64 (= sizeof(long) * 8). This sort of addition to the kernel would make it a lot easier to create scripts which just do "the right thing" when run in anohter environment Just my 0,02 EUR worth... Cheers, // jau .--- ..- -.- -.- .- .- .-.-.- ..- -.- -.- --- -. . -. / Jukka A. Ukkonen, Oxit Ltd, Finland /__ M.Sc. (sw-eng & cs) (Phone) +358-500-606-671 / Internet: Jukka.Ukkonen(a)Oxit.Fi / Internet: jau(a)iki.fi v .--- .- ..- ...-.- .. -.- .. .-.-.- ..-. .. + + + + My opinions are mine and mine alone, not my employers. + + + +