uname -m/-p for compat32 binaries

Nathan Whitehorn nwhitehorn at freebsd.org
Wed Jul 21 21:30:18 UTC 2010


On 07/21/10 07:00, Kostik Belousov wrote:
> On Tue, Jul 20, 2010 at 03:48:57PM -0500, Nathan Whitehorn wrote:
>    
>> On 07/20/10 08:07, John Baldwin wrote:
>>      
>>> On Monday, July 19, 2010 5:30:54 pm Kostik Belousov wrote:
>>>
>>>        
>>>> Hi,
>>>> I intend to commit the following change, that makes sysctls
>>>> hw.machine_arch and hw.machine to return "i386" for 32 bit
>>>> binaries run on amd64. In particular, 32 bit uname -m and uname -p
>>>> print "i386", that is good for i386 jails on amd64 kernels.
>>>>
>>>> I find the change very useful for me, but I wonder why such trivial
>>>> modification is not yet done. Can anybody note a possible fallout from
>>>> it ?
>>>>
>>>>          
>>> Presumably ia64 and powerpc64 would need a similar change as well?  It
>>> looks
>>> fine to me.  I suspect Y! used the UNAME_* approach as it didn't add yet-
>>> another local diff to maintain in the kernel, and the uname fixes at Y!
>>> might
>>> have predated SCTL_MASK32.
>>>
>>>        
>> Maybe it makes sense to define a MACHINE_ARCH32 in machine/param.h, as
>> is done for ELF_ARCH32 in machine/elf.h? This would keep the MI code in
>> the kernel MI, and ever-so-slightly simplify implementation for ia64,
>> mips, and powerpc64. Thanks for doing this!
>>      
> See below. Also, I painted red another wall, adding a sysctl to turn
> the adaptive behaviour off.
>
>    

I quite like the shade you've chosen!
-Nathan



More information about the freebsd-amd64 mailing list