Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gethostname(2) — DG/UX 4.30

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gethostid(2)

getdomainname(2)

sethostname(2)



     gethostname(2)             DG/UX 4.30              gethostname(2)



     NAME
          gethostname - Get name of current host.

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

     PARAMETERS
          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.

     EXCEPTIONS
          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
          The related manual sections:  gethostid(2),
          getdomainname(2), sethostname(2).










     Licensed material--property of copyright holder(s)         Page 1



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