[0m


GETHOSTNAME(2)	    UNIX Programmer's Manual	   GETHOSTNAME(2)



[1mNAME
     [0mgethostname, sethostname - get/set name of current host

[1mSYNOPSIS
     gethostname(name, namelen)
     char *name;
     int namelen;

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

DESCRIPTION
     [0m_G_e_t_h_o_s_t_n_a_m_e returns the standard host name for the current
     processor, as previously set by _s_e_t_h_o_s_t_n_a_m_e.  The parameter
     _n_a_m_e_l_e_n specifies the size of the _n_a_m_e array.  The returned
     name is null-terminated unless insufficient space is pro-
     vided.

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

[1mRETURN VALUE
     [0mIf the call succeeds a value of 0 is returned.  If the call
     fails, then a value of -1 is returned and an error code is
     placed in the global location _e_r_r_n_o.

[1mERRORS
     [0mThe following errors may be returned by these calls:

     [EFAULT]	    The _n_a_m_e or _n_a_m_e_l_e_n parameter gave an invalid
		    address.

     [EPERM]	    The caller tried to set the hostname and was
		    not the super-user.

[1mSEE ALSO
     [0mgethostid(2)

[1mBUGS
     [0mHost names are limited to MAXHOSTNAMELEN (from
     <_s_y_s/_p_a_r_a_m._h>) characters, currently 64.











Printed 25/11/93    Revision 1.2 of 19/10/88			1



[0m