Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sethostname(2) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getdomainname(2)

gethostid(2)

gethostname(2)

uname(1)

uname(2)



sethostname(2)                 DG/UX 5.4R3.00                 sethostname(2)


NAME
       sethostname - set name of current host

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

   where:
       name      Name to set for host

       namelen   Length of name in bytes

DESCRIPTION
       Sethostname sets the name of the host node to name, which has length
       namelen.  Only the superuser may use this call; it is normally used
       at boot time.

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

ACCESS CONTROL
       Only the superuser can set the hostname.

RETURN VALUE
       0      Completed successfully.

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

DIAGNOSTICS
       Errno may be set to one of the following error codes:

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

       EPERM     The caller was not the superuser.

SEE ALSO
       getdomainname(2), gethostid(2), gethostname(2).  uname(1), uname(2)

NOTES
       This system call also modifies the node name that is contained in the
       system's utsname structure.  Subsequent calls to uname -n will return
       this new node name.












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


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