Table of Contentsgetdomainname, setdomainname - get/set domain name #include <unistd.h> int getdomainname(char *name, size_t len);
int setdomainname(const char *name, size_t len);
These functions are used to access or to change the domain name of the current processor. On success, zero is returned. On error, -1 is returned, and errno is set appropriately. - EINVAL
- For getdomainname, name points to NULL or name is longer than len.
- EPERM
- For setdomainname, the caller was not the superuser.
- EINVAL
- For setdomainname, len was too long.
POSIX does not specify these calls. getdomainname is not compliant with other implementations, since they always return len bytes, even if name is longer. Linux, however, returns EINVAL in this case (as of DLL 4.4.1 libraries). Under Linux, getdomainname is implemented at the library level by calling uname(2). gethostname(2), sethostname(2), uname(2)
Table of Contents
www.fiveanddime.net