Why do uname -p and uname -m and arch output different architectures?

On mountain lion (late 2010)

$ uname -p
i386
$ uname -m
x86_64
$ arch
i386

So i368 (32 bit) is my processor architecture, and x86_64 (64 bit) is my machine hardware name according to the uname man page. So why such results from uname and arch? And what exactly is machine hardware name?


Solution 1:

I found this link, Re: Mac OS X Snow Leopard and 64-bit applications, which says:

arch and uname -p both return the processor family type, i386. (as opposed to ppc or arm.)  I think the rationale was that too many scripts depend upon this behavior.

uname -m tells you which slice of xnu you booted from, i.e. x86_64 for the 64 bit kernel, i386 for the 32 bit kernel.

It's unfortunate that the phrase i386 has two meanings.

This clarifies the issue.