gethostname()

get name of current host 

Function


SYNOPSIS

#include <unistd.h>

int gethostname(const char *name, int namelen);


DESCRIPTION

The gethostname() function gets the name of the current host.


PARAMETERS

name 

Points to a buffer that is to receive the host name.

namelen 

Is the size of the buffer pointed to by name.


RETURN VALUES

If successful, gethostname() returns 0. On failure, it returns -1 and sets errno to one of the following values.

EFAULT 

name is an invalid pointer.

ENETDOWN 

The network subsystem has failed.


CONFORMANCE

4.4BSD.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
uname()


PTC MKS Toolkit 10.5 Documentation Build 40.