Re: RFC: Adding a hw.features[2] sysctl

From: Daniel O'Connor <doconnor_at_gsoft.com.au>
Date: Mon, 14 Jan 2008 12:54:18 +1030
On Mon, 14 Jan 2008, Igor Mozolevsky wrote:
> On 13/01/2008, Peter Jeremy <peterjeremy_at_optushome.com.au> wrote:
> > IMHO, no.  Virtually all similar FreeBSD information is exported
> > via sysctl and this sort of information fits neatly into the
> > existing MIB tree as either dev.cpu.N.features or hw.cpu.features
>
> /dev/sndstat?

A single handy counter example to the many many that are sysctls :)

> If it's in /dev you can do neat tricks like ioctl-ing queries (like
> ioctl(/dev/cpuinfo, CINFOCTL_HAS_FEATURES, CINFO_SSE3|CINFO_SSSE3))
> instead of having *every* app parse the result of a sysctl; most of
> the time you'd only want to check for specific feature , it's much
> easier to do an ioctl that returns a boolean.

Except you can't do that from a shell script.
(eg wrapper script to run optimised binaries)

sysctl is easy and sysctl is common, just use it..

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Received on Mon Jan 14 2008 - 01:24:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:25 UTC