Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gethostid(2)



GETHOSTNAME(2)          COMMAND REFERENCE          GETHOSTNAME(2)



NAME
     gethostname, sethostname - get/set name of current host

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

     sethostname(name, namelen)
     char *name;
     int namelen;

DESCRIPTION
     Gethostname returns the standard host name for the current
     processor, as previously set by sethostname.  The parameter
     namelen specifies the size of the name array.  The returned
     name is null-terminated unless insufficient space is
     provided.

     Sethostname sets the name of the host machine to be name,
     which has length namelen.  This call is restricted to the
     super-user and is normally used only when the system is
     bootstrapped.

DIAGNOSTICS
     The following errors may be returned by these calls:

     [EFAULT]            The name or namelen parameter gave an
                         invalid address.

     [EPERM]             The caller was not the super-user.
                         Applies only to sethostname.

RETURN VALUE
     [0]                 Successful call.

     [-1]                Unsucessful call.  An error code is
                         placed in the global location errno.

CAVEATS
     Host names are limited to 255 characters.

SEE ALSO
     gethostid(2).











Printed 10/17/86                                                1



%%index%%
na:72,91;
sy:163,745;
de:908,795;
di:1703,402;
rv:2105,256;
ca:2361,98;
se:2459,98;
%%index%%000000000117

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