HP-UX 11i December 2003 Release Notes

Programming
Miscellaneous
Chapter 15
300
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
the following:
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, and then call confstr() again to get the actual value.