Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Feb 2005 00:53:35 -0500
From:      David Schultz <das@FreeBSD.ORG>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/77355: Detect i*86 subarches for uname
Message-ID:  <20050213055335.GA67206@VARK.MIT.EDU>
In-Reply-To: <200502111410.j1BEATUL015405@freefall.freebsd.org>
References:  <200502111410.j1BEATUL015405@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@sygyt:~> uname -m
i686
das@sygyt:~> uname -p
i686

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

athena% uname -a
SunOS biohazard-cafe.mit.edu 5.9 Generic_117171-14 sun4u sparc SUNW,Sun-Fire-V440
athena% uname -m
sun4u
athena% uname -p
sparc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050213055335.GA67206>