gethostname man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

gethostname(2)							gethostname(2)

NAME
       gethostname() - get name of current host system

SYNOPSIS
DESCRIPTION
       returns	in  the array to which hostname points, the standard host name
       for the current system as set by (see sethostname(2)).  size  specifies
       the  length  of the hostname array.  hostname is null-terminated unless
       insufficient space is provided.

RETURN VALUE
       returns 0 if successful.	 Otherwise, it returns −1 and sets to indicate
       the error.

ERRORS
       can fail if the following is true:

       hostname	      points to an illegal address.  The reliable detection of
		      this error is implementation dependent.

       size	      is less than one.

WARNINGS
       It is recommended that programs use to dynamically size the buffer used
       to  accept  the	host  name from This is preferred over use of the con‐
       stant.

       For cases where the constant must be used, there are two values: 64 and
       256.  The smaller value is compatible with current releases and is used
       by default.  To use the larger value consult the related	 documentation
       (see nodehostnamesize(5)).

       The  administrator may, with appropriate configuration options enabled,
       set a host name larger than 64 bytes.  Existing applications which were
       compiled	 using the smaller to size a buffer passed to the system func‐
       tion obtain only the first 64 bytes.  This  truncation  may  cause  the
       applications to exhibit anomalous behavior or to fail.

AUTHOR
       was developed by the University of California, Berkeley.

SEE ALSO
       hostname(1), uname(1), sethostname(2), uname(2), nodehostnamesize(5).

								gethostname(2)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net