"Rick Troth" wrote:
> 'hostid' should probably be retooled for zSeries.

"Retooled" is probably a somewhat "heavy" term for optionally
calling the sethostid function once during installation, which
will store its argument value in /etc/hostid, from where
gethostid will fetch it henceforth.

> In my experience,  it started with Sun where each motherboard
> had (has) a unique serial number.   Memory is a little fuzzy
> but it was (is) probably tied to the MAC address (ethernet HW addr)
> which followed (follows) the motherboard in many cases.

I'm not sure where it originally started, but the manual
pages all indicate that the gethostid function was originally
introduced in 4.2BSD, which dates it at 1982/1983.
Given that SunOS is documented to be originally based on
4.2BSD, I think it is reasonable to assume that Sun got it
from 4.2BSD, and not the other way around.

Both the BSD and the Linux manual pages mention that the
"normal" value is related to the Internet address of the
local machine.  No mention of MAC address or processor
serial number.

Note the interesting history of this function.  It was
introduced in 1982 in 4.2BSD, with the intent of providing
a 32-bit identifier that was unique among all UNIX systems
in existence.  It was then removed in 4.4BSD, but meanwhile
inherited by System V Release 4, and from there it ended up
in some "official" standards.  (although in the Single Unix
Specification the specification is so diluted as to be
meaningless: "The Open Group does not define the domain
in which the return value is unique.")
I think it is a mistake that has survived far longer than
it should have...

> Linux then emulated this nifty tool,  but did so sloppily.

Actually, Linux does not implement gethostid at all.
It is the GNU C library that implements it at user level,
and I don't think it "did so sloppily", given that it
follows the original BSD spec quite closely.
(although perhaps not the SunOS spec...)

> Well ... for older PCs what we have is better than nothing,  IMHO.
> But again,  should be retooled so that where the processor
> supports a serial number,  that is what gets reported.

I don't understand the logic that lead you to say this.

The gethostid function has well-defined semantics, has had
these since 1982, and the current implementation on Linux
provides these semantics just fine (on old and new PCs, old
and new Sun systems, old and new RS/6000s, and even on S/390).

If you want different semantics for some processor serial
number function, then please use another interface for that.
A processor serial number is only unique for that particular
vendor and model of processor, which does not satisfy the
documented purpose of the gethostid function.


--
     Willem Konynenberg <[EMAIL PROTECTED]>

Reply via email to