New machine identifier, partition identifier, and serial number
parameters have been defined for the confstr() library function.
The new parameters for confstr() are defined as follows:
- _CS_MACHINE_IDENT
Identifier for each physical machine. Returned as
an opaque string of printable ascii characters.This string has the
same value for all partitions in a physical machine. For hardware
classes first released with HP-UX 11i or later, this ID is unique
across all hardware classes. For earlier hardware classes, the ID
number is unique only within the hardware class. A null string is
returned if no ID number is available; this is expected to be the
case only for prototype machines or other systems improperly configured
in manufacturing.
- _CS_PARTITION_IDENT
Identifier for each partition existing on a machine.
Returned as an opaque string of printable ascii characters. For
any machine not supporting partitions this value will be same as
_CS_MACHINE_IDENT.
- _CS_MACHINE_SERIAL
Machine serial number as found labeled on the external
machine chassis. The value will be a printable ascii string. This
string is not available on all classes of machines; if unavailable,
the string will be empty. This string is not a unique identifier
of the machine, since machines of different classes can have the
same serial number.
If a unique identifier is needed, use _CS_MACHINE_IDENT or
_CS_PARTITION_IDENT.
The preferred method of calling these functions is defined
in the confstr(3C) manpage as:
bufsize=confstr(_CS_MACHINE_IDENT,NULL,(size_t)0); buffer=(char *)malloc(bufsize+1); confstr(_CS_MACHINE_IDENT,buffer,bufsize+1); |
The first line will return the length of the string to be
returned, allocate memory based on this value, then call confstr() again to get the actual value.