Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
gethostname() z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
The gethostname() call returns the name of the host processor
on which the program is running. Characters to the limit of namelen are copied into the name array. The value
returned for host name is limited to 24 characters. The returned name
is NULL-terminated unless truncated to the size of the name array.
Note: The host name returned is the host name the TCPIP stack learned at
startup from the TCPIP.DATA file that was found.
This call can be used only in the AF_INET domain. Errno EINVAL is returned when namelen is 0, or greater than 255 characters.
Return valuesThe value 0 indicates success;
the value -1 indicates an error. Errno identifies the specific error.
Related callsgethostbyname(), gethostid() |
Copyright IBM Corporation 1990, 2014
|