Query: gethostname
OS: hpux
Section: 2
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
gethostname(2) System Calls Manual gethostname(2)NAMEgethostname() - get name of current host systemSYNOPSISDESCRIPTIONreturns in the array to which hostname points, the standard host name for the current system as set by (see sethostname(2)). size speci- fies the length of the hostname array. hostname is null-terminated unless insufficient space is provided.RETURN VALUEreturns 0 if successful. Otherwise, it returns -1 and sets to indicate the error.ERRORScan 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.WARNINGSIt 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 function obtain only the first 64 bytes. This truncation may cause the applications to exhibit anomalous behavior or to fail.AUTHORwas developed by the University of California, Berkeley.SEE ALSOhostname(1), uname(1), sethostname(2), uname(2), nodehostnamesize(5). gethostname(2)
Related Man Pages |
---|
sethostname(2) - redhat |
gethostname(3c) - opensolaris |
sethostname(2) - hpux |
sethostname(3c) - opendarwin |
gethostname(3c) - xfree86 |
Similar Topics in the Unix Linux Community |
---|
hp-ux or not? |
Hostname - System Name |
Change HostName |
Earth System Modeling Framework 3.1.0rp1 (Default branch) |