Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gethostname(2) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getdomainname(2)

gethostid(2)

sethostname(2)



gethostname(2)                    SDK R4.11                   gethostname(2)


NAME
       gethostname - get name of current host

SYNOPSIS
       #include <unistd.h>
       int  gethostname (name, namelen)
       char * name;
       int  namelen;

   where:
       name      Buffer to receive hostname

       namelen   Buffer length in bytes

DESCRIPTION
       Gethostname returns the standard hostname for the host system, as
       previously set by sethostname.  The parameter namelen specifies the
       size of the name string.  The returned name is null-terminated unless
       insufficient space is provided.  Insufficient space will truncate the
       name.

       Hostnames are limited to MAXHOSTNAMELEN characters, which is defined
       in <sys/param.h>.

       Calling gethostname before calling sethostname returns a zero-length
       hostname.

ACCESS CONTROL
       None.

RETURN VALUE
       0      Completed successfully.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to the following error code:

       EFAULT    The name parameter gave an invalid address, or the namelen
                 parameter specified a length less than zero.

SEE ALSO
       getdomainname(2), gethostid(2), sethostname(2).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026