Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit


» HP STK home
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
Content starts here

critical impact:

MAXHOSTNAMELEN constant - different value (CrCh106)

NW Impacts

Problem description

The MAXHOSTNAMELEN constant is the maximum length of Internet host name strings, and is defined differently on Tru64 UNIX and HP-UX.

The MAXHOSTNAMELEN constant is the size of the largest host name the system can handle. On Tru64 UNIX, it is 256 characters; on HPUX, 64 characters. This might affect programs using the following APIs and commands: hostname(1), gethostname(2), and sethostname(2). If the code is not using the MAXHOSTNAMELEN constant, you must still ensure that any buffers containing a host name in the code are defined to be less than MAXHOSTNAMELEN.

Starting with HPUX 11iv3, long node and host names sizes are supported. This feature enables user to set hostname of length 256 characters.


C/C++ Functionsgethostname C/C++ Misc. IdentifiersMAXHOSTNAMELEN  
UNIX Commandshostname C/C++ Functionssethostname  

See also

Solution description

Change long host names to be less than MAXHOSTNAMELEN.

A future version of HP-UX will include a larger MAXHOSTNAMELEN. If your code or script is using sethostname(2) or hostname(1) to set the hostname of the system, you must ensure that the name is less than 64 characters.

HPUX 11iv3 supports long node and host names. Applications which want to take advantage of long node and host names should perform the following on HPUX 11iv3:

  • Compile your application with -D_HPUX_API_LEVEL=20040821 option.
  • Ensure that you have provided large buffer size of 256 characters.
For more information please refer whitepaper, "Node and Host Name Sizes on HP-UX: Using the Expanded Capabilities" on http://docs.hp.com

See also

Problem summary

classifications source types OS release severity type
NW C, C++, Script any HP-UX 11i version critical changed
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.