sysctl ???

Joshua Root jmr at macports.org
Wed Apr 17 22:26:07 PDT 2013


On 2013-4-17 20:31 , vincent habchi wrote:
> Hi Josh,
> 
>> There is no "standard Tcl ‘sysctl’ call". The sysctl proc you can call
>> from portfiles is defined in src/macports1.0/sysctl.c. It's just a thin
>> wrapper around sysctlbyname(3) to make it available from Tcl.
> […]
>>> but this code in Macports:
>>>
>>>    if {![catch {sysctl hw.machine} result]} {
>>>        set native_arch ${result}
>>>        puts ${result}
>>>    }
>>>
>>> reports ‘32767’
>>>
>>> How come?
>>
>> Probably because someone (cough) only implemented support for
>> CTLTYPE_INT and CTLTYPE_QUAD in the function...
> 
> Okay :) I’ll modify the Portfile so it reads
> 
> catch {exec sysctl -n …}
> 
> which works.

BTW, are you aware that hw.machine is i386 on some x86_64 systems such
as Mac Pro 1,1? That probably doesn't break anything in the atlas port
from what I can see, but it seems contrary to the native_arch variable's
apparently intended meaning.

- Josh


More information about the macports-dev mailing list