Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Oct 2011 21:54:33 +0300 (EEST)
From: (Jukka A. Ukkonen)
Subject:   A couple of new sysctl variables - maybe?
Message-ID:  <>

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

Just my 0,02 EUR worth...

		// 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)
        .---  .-  ..-  ...-.-  ..  -.-  ..  .-.-.-  ..-.  ..
+ + + + My opinions are mine and mine alone, not my employers. + + + +

Want to link to this message? Use this URL: <>