blob: 4c7deff6e48b08db9447395b5cda25e8df0024e1 [file] [log] [blame]
/*
* getdomainname.c
*/
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/utsname.h>
int getdomainname(char *name, size_t len)
{
struct utsname un;
if ( !uname(&un) )
return -1;
if ( len < strlen(un.domainname)+1 ) {
errno = EINVAL;
return -1;
}
return 0;
}