Operating System - HP-UX
1826213 Members
2726 Online
109691 Solutions
New Discussion

Re: confstr truncate's model string on some platforms.

 
John Mannion
Occasional Advisor

confstr truncate's model string on some platforms.

I have used the following code snippet to
determine model on HP-UX. In 99% of the
cases this works fine but in a minority
of cases the model string returned is truncated
by one character.

len=confstr(_CS_MACHINE_MODEL,NULL,(size_t)0);
buf2 = new char[len];
confstr(_CS_MACHINE_MODEL,buf2,len);

Should we be using len+1 instead. What are the
implications of doing this ? The 11.00 man
page for confstr seems to indicate this
but not for 11.11.

Thanks for any help


2 REPLIES 2
Xavier Gutierrez_2
Frequent Advisor

Re: confstr truncate's model string on some platforms.

Hi, John.

Have you checked if the patch level of the boxes that provide truncated output is the same as the ones that show correctly?

Also, it could be related to the diagnostics version...

Most probably linked with the revision of the HWEnablement Bundle that is installed on the box...


Hope this helps,

Javier.
John Mannion
Occasional Advisor

Re: confstr truncate's model string on some platforms.

Hi

it turns out that ..

* All patched versions of /usr/lib/libc.2 prior to and including PHCO_19491
(posted Aug 20 1999) exhibit the problem

* All patched versions after and including the subsequent patch PHCO_19691
(posted Oct 10 1999) do NOT exhibit the problem.

so once the latest libc cumulative patch was applied all was fine..

John