[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
inconsistent "uname -s" option
From: |
Robert Millan |
Subject: |
inconsistent "uname -s" option |
Date: |
Mon, 14 Jul 2003 18:39:24 +0200 |
User-agent: |
Mutt/1.5.4i |
Hi!
I've found that the -s option in GNU uname has some serious inconsistency
problems. From --help output:
"-s, --kernel-name print the kernel name"
The first problem is:
With a single exception, this isn't true for any system: "HP-UX", "AIX",
"FreeBSD", "NetBSD", "OpenBSD", etc.. they're all complete OSes and not
just kernels. But GNU uname running on any of these will say they are
kernels.
The exception is GNU/Linux, since it prints "Linux" which is the kernel. This
is due to the well-known fact that Linux' developers refused to give credit
to GNU when they started building a Linux-based GNU system. The correct
solution would be to fix uname () to return "GNU/Linux" as sysname, in
either Glibc or the kernel Linux. I don't think this is technicaly viable,
though.
The second problem is not adhering to standards:
- POSIX says "-s" should:
"Write the name of the implementation of the operating system."
- And you're using uname () system call to obtain the string, which
according to POSIX is expected to provide:
"char sysname[] Name of this implementation of the operating system."
- And particularly, the GNU C library's specification on uname () says:
"char sysname[] This is the name of the operating system in use."
I propose two solutions:
- Make the --help output dependant on the platform, and only say "-s"
is for the kernel when running uname on GNU/Linux. This has the advantage
that we'd be telling correct output for all systems but at the inconvenient
of having to maintain documentation for different options on different
platforms. I can send a patch for this if you like.
- Revert it to the old behaviour. This has the only disadvantage that uname
would say "Linux" is the system. But GNU uname is just a messenger; if
you really want to fix this you should discuss it with the maintainers
of Glibc and/or the maintainers of Linux.
Thanks for your time,
--
Robert Millan
- inconsistent "uname -s" option,
Robert Millan <=