HP 3000 Manuals

GETHOSTNAME [ Berkeley Sockets/iX Reference Manual ] MPE/iX 5.0 Documentation


Berkeley Sockets/iX Reference Manual

GETHOSTNAME 

C Interface 

          #include <unistd.h>

          int gethostname(hostname, size);
          char *hostname;
          size_t size;

Description 

The gethostname system call returns the standard host name for the
current processor as set by sethostname.  The size parameter specifies
the length of the hostname array.  The hostname is null-terminated unless
insufficient space is provided.

Return Value 

If the call is successful, a 0 is returned.  If it fails, a -1 is
returned, and an error code is stored in errno.

Errors 

The following error is returned by gethostname:

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

MPE/iX Specific 

This call returns the node name configured in the local domain name field
in NMMGR.

Author 

UCB (University of California at Berkeley)



MPE/iX 5.0 Documentation