GETHOSTNAME(2) 1990 GETHOSTNAME(2) NNAAMMEE gethostname, sethostname - get/set name of current host SSYYNNOOPPSSIISS ggeetthhoossttnnaammee((nnaammee,, nnaammeelleenn)) cchhaarr **nnaammee;; iinntt nnaammeelleenn;; sseetthhoossttnnaammee((nnaammee,, nnaammeelleenn)) cchhaarr **nnaammee;; iinntt nnaammeelleenn;; DDEESSCCRRIIPPTTIIOONN _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. RREETTUURRNN VVAALLUUEE If 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. EERRRROORRSS The 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. SSEEEE AALLSSOO gethostid(2) BBUUGGSS Host names are limited to MAXHOSTNAMELEN (from <_s_y_s/_p_a_r_a_m._h>) characters, currently 64. Printed 7/27/90 June 1