getdomainname -- get domain name
#include <unistd.h>
int getdomainname(char *name, size_t len);
This function is used to access or to change the domain name of the current machine. If the NUL-terminated domain name requires more than len bytes, getdomainname(2) returns the first len bytes (glibc) or returns an error (libc).
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
POSIX.1? does not specify these calls. POSIX.3? does. Who knows about POSIX.2?
4 pages link to getdomainname(2):