A couple of new sysctl variables - maybe?
Jukka A. Ukkonen
jau at iki.fi
Wed Oct 5 18:54:37 UTC 2011
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
Just my 0,02 EUR worth...
.--- ..- -.- -.- .- .- .-.-.- ..- -.- -.- --- -. . -.
/ 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
.--- .- ..- ...-.- .. -.- .. .-.-.- ..-. ..
+ + + + My opinions are mine and mine alone, not my employers. + + + +
More information about the freebsd-questions