C
int gethostname( char* name, int namelen );
Description
This function returns the standard host name of the system which is calling this function. The returned name is null-terminated.
Preconditions
None.
Parameters
Parameters |
Description |
name |
Pointer to a buffer that receives the local host name. |
namelen |
size of the name array. |
Returns
Success will return a value of 0. If name is too short to hold the host name or any other error occurs, SOCKET_ERROR (-1) will be returned. On error, *name will be unmodified and no null terminator will be generated.
Remarks
None.