getdomainname

Name

getdomainname -- get NIS domain name (DEPRECATED).

Synopsis

#include <unistd.h>

int getdomainname (char * name , size_t namelen );

Description

If the Network Information System (NIS) is in use, getdomainname() shall copy the NIS domain name to the supplied buffer identified by name, with maximum length namelen. If the NIS domain name is not currently set, getdomainname() shall copy the string "(none)" to the name. If namelen is less the length of the string to be copied, getdomainname() may either truncate the string to namelen characters and place it in name (without a terminating null character), or may fail with EINVAL.

Note that the NIS domain name is not the same as the domain portion of a fully qualified domain name (for example, in DNS).

Return Value

On success, getdomainname() shall return 0. Otherwise, it shall return -1 and set errno to indicate the error).

Errors

EINVAL

name was a null pointer.

EINVAL

The buffer identified by name and namelen is of insufficient size to store the NIS domain name string, and the implementation considers this an error.

Future Directions

The LSB does not include other NIS interfaces, and a future version of this specification may deprecate this interface. Application developers should avoid using this interface where possible.