getdomainname(3) CLIX getdomainname(3)
NAME
getdomainname, setdomainname - Gets or sets name of current domain
LIBRARY
Berkeley Software Distribution Library (libbsd.a)
SYNOPSIS
int getdomainname(
char *name ,
int namelen );
int setdomainname(
char *name ,
int namelen
PARAMETERS
name A pointer to a character string representing the name of the
domain of the host machine.
namelen The length of the name string.
DESCRIPTION
The getdomainname() function returns the name of the domain for the host
machine as previously set by setdomainname(). The parameter namelen
specifies the size of the name array. The returned name is null-
terminated unless insufficient space is provided.
The setdomainname() function sets the domain of the host machine to be
name, which has length namelen. This call is restricted to the superuser
and is normally used only at boot time.
Domains enable two distinct networks that may have hostnames in common to
merge. Each network is distinguished by having a different domain name.
Currently, only the Network Information Service (NIS) service uses
domains.
Domain names are limited to 64 characters.
NOTES
Only the superuser can set the domain name.
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise,
getdomainname() sets errno to one of the following values.
2/94 - Intergraph Corporation 1
getdomainname(3) CLIX getdomainname(3)
ERRORS
The following errors may be returned by these calls:
[EFAULT] The name parameter gave an invalid address.
[EPERM] The caller was not the superuser. This error only applies to
setdomainname().
2 Intergraph Corporation - 2/94