Date: Wed, 5 Oct 2011 21:54:33 +0300 (EEST) From: jau@iki.fi (Jukka A. Ukkonen) To: questions@freebsd.org Subject: A couple of new sysctl variables - maybe? Message-ID: <201110051854.p95IsXbr028001@jau.iki.fi>
next in thread | raw e-mail | index | archive | help
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. + + + +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110051854.p95IsXbr028001>