kern/77355: Detect i*86 subarches for uname

David Schultz das at FreeBSD.ORG
Sat Feb 12 21:53:46 PST 2005

On Fri, Feb 11, 2005, Bruce Evans wrote:
>  It is needed for correctness.  From "man uname | col -bx":
>  %%%
>       -m      Write the type of the current hardware platform to standard out-
>               put.
>       ...
>       -p      Write the type of the machine processor architecture to standard
>               output.
>  %%%
>  -p is supposed to give the arch (e.g., -i386) and -m is supposed to
>  give the platfrom (is that the sub-arch?) (e.g., i686).  It is useless
>  for these to return the same string.  (i686 is also useless, since it
>  is the same for all i386's newer than about 8 years old, but that is
>  another bug.  The hw.model sysctl gives more useful info (e.g.,
>  "AMD Athlon(tm)"), but uname(1) only uses uname(2) which doesn't go
>  near this sysctl.)

FWIW, Linux gets this wrong in the other direction (i686 for
both.)  Solaris does better.  Here are some data points:

das at sygyt:~> uname -a
Linux sygyt 2.4.22-1.2194.nptl #1 Thu Jun 17 10:58:40 EDT 2004 i686 i686 i386 GNU/Linux
das at sygyt:~> uname -m
das at sygyt:~> uname -p

das at VARK:~> uname -a
FreeBSD VARK.MIT.EDU 6.0-CURRENT FreeBSD 6.0-CURRENT #39: Sat Feb 12 04:37:35 EST 2005     das at VARK.MIT.EDU:/usr/home/t/freebsd/vark/usr/home/t/freebsd/vark/src/sys/GENERIC  i386
das at VARK:~> uname -m
das at VARK:~> uname -p

athena% uname -a
SunOS 5.9 Generic_117171-14 sun4u sparc SUNW,Sun-Fire-V440
athena% uname -m
athena% uname -p

More information about the freebsd-bugs mailing list