GETDOMAINNAME(2) UNIX Programmer's Manual GETDOMAINNAME(2) NAME getdomainname, setdomainname - get/set name of current domain SYNOPSIS getdomainname(name, namelen) char *name; int namelen; 9 setdomainname(name, namelen) char *name; int namelen; DESCRIPTION _G_e_t_d_o_m_a_i_n_n_a_m_e returns the name of the domain for the current processor, as previously set by _s_e_t_d_o_m_a_i_n_n_a_m_e. The parame- ter _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 provided. _S_e_t_d_o_m_a_i_n_n_a_m_e sets the domain 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. The purpose of domains is to enable two distinct networks that may have host names in common to merge. Each network would be distinguished by having a different domain name. At the current time, only the yellow pages service makes use of domains. RETURN VALUE 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. ERRORS The following errors may be returned by these calls: [EFAULT] The _n_a_m_e parameter gave an invalid address. [EPERM] The caller was not the super-user. This error only applies to setdomainname. BUGS Domain names are limited to 255 characters. 9 Printed 12/27/86 19 August 1985 1