tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Not exporting MACHINE and MACHINE_ARCH from <machine/param.h>



On Mon, 16 Sep 2013, Matt Thomas wrote:
Currently we export MACHINE and MACHINE_ARCH from <machine/param.h> which is included from <sys/param.h>.
I think we shouldn't relay on those and should instead rely on 
sysctl (directly or indirectly [uname]) to fetch hw.machine or 
hw.machine_arch, respectively.
I agree that userland should use a run-time value, not 
a compile-time value, for the equivalent of MACHINE and 
MACHINE_ARCH.
struct utsname, as returned by uname(3), includes "machine" but 
not "machine_arch".  Perhaps it's time to extend uname(3) to be 
able to return everything that uname(1) can print.
--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index