From: guy@netapp.com (Guy Harris)
Subject: Re: Portable startup files question..
Date: 1995/05/26 [thread overview]
Message-ID: <3q5mhi$hdf@nova.netapp.com> (raw)
In-Reply-To: D96r1s.6MM@encore.com
[followups to "comp.unix.shell", as that's probably the group in which
this is most appropriate]
Thanh Ma <tma@encore.com> wrote:
[unnecessarily-included copy of the entire previous posting
deleted]
>$ uname -s
>UNIX_SV
>$ uname -n
>infcons
>$ uname -r
>4.2MP
>$ uname -v
>2.01
>$ uname -m
>i386
>$ uname -p
>x86at
I.e., "uname -m" gives the instruction-set architecture, but "uname -p"
gives some indication of the type of machine - if "x86at" means
"x86-instruction-set-architecture-based machine remotely descended from
the IBM PC/AT", i.e. "IBM-compatible PC", then I guess it counts as the
"kernel architecture".
I *thought* I'd remembered that x86 SVR4 swapped "uname -m" and "uname
-p" from what at least some other flavors of SVR4 (e.g., SunOS 5.x) did
on non-x86 platforms; alas, it appears I was correct. Sigh....
I suspect SunOS 5.x on IBM-compatible PC's does as other SVR4-flavored
UNIXes do; if so, then the cases for SunOS 5.x, and for "UNIX_SV",
should do something such as check whether "uname -m" is "i386" and, if
so, use *that* as the architecture, and otherwise use "uname -p" -
unless, of course, SVR4s on some *other* platforms act like x86 SVR4
rather than other SVR4's.
Note that BSD/OS 1.1 doesn't support "uname -p", but has a "uname -m"
that produces "i386", so it'd fall into the same category:
% uname -p
uname: illegal option -- p
usage: uname [-snrvma]
% uname -m
i386
% uname -s
BSD/386
(BSD/OS 1.x was called "BSD/386" as it was PC-only; 2.x may get a port
to some SPARC machines and possibly others, and may call itself "BSD/OS").
However, on at least one Linux system, "uname -m" appears to say what
*flavor* of x86 chip you have, rather than that you have a chip that
supports the 32-bit version of the x86 architecture by saying "i386", so
on Linux (on which, at least one Linux system, "uname -s" prints
"Linux"), you have to handle "i586" and probably "i486" and map them to
"i386" (unless you really give a damn about the tiny additions the 486
and Pentium made to the user-mode instruction set).
At times, I want to send the folks who did "uname" commands and
"uname()" calls on various flavors of Unix to the penal colony in
Kafka's "In the Penal Colony", and set the machine to carve "give
'uname' an option to print out the ABI/instruction set architecture"
into their backs....
(And, no, POSIX doesn't help. 1003.2-1992 says "uname -m" should "Write
the name of the hardware type on which the system is running to standard
output", but I don't see any mention of "hardware type" in the index, so
I suspect they don't define it - probably so no system would actually
have to fix its behavior, even if that renders "uname -m" not convenient
to use in, oh, say, a *PORTABLE STARTUP SCRIPT* such as the original
poster wanted. 1003.1b-1993 says pretty much the same thing for
"uname()".)
next prev parent reply other threads:[~1995-05-26 4:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-05-21 4:00 Portable startup files question Ricardo Marek
1995-05-21 4:00 ` Uwe Leinberger
1995-05-22 4:00 ` Ido Sarig
1995-05-22 4:00 ` Guy Harris
1995-05-24 4:00 ` Dale DePriest
1995-05-25 4:00 ` Guy Harris
1995-05-26 4:00 ` Thanh Ma
1995-05-26 4:00 ` Guy Harris [this message]
1995-06-02 4:00 ` Christopher Samuel
1995-05-21 4:00 ` tim werner
1995-05-22 4:00 ` Guy Harris
1995-05-23 4:00 ` Larry Gale
1995-05-26 4:00 ` Syed Zaeem Hosain
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox