Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
NAME
getdnsconfig, setdnsconfig — get and set the kernel DNS resolver listSYNOPSIS
#include <sys/dnsconfig.h>getdnsconfig(struct dnsconfig *cfg);
getdnsconfig(const struct dnsconfig *cfg);
DESCRIPTION
getdnsconfig() gets and setdnsconfig() sets the kernel DNS resolver list.
struct dnsconfig { 
	size_t servers_count; 
	struct dnsconfig_server servers[DNSCONFIG_MAX_SERVERS]; 
}
union dnsconfig_server_union { 
	struct in_addr in; 
	struct in6_addr in6; 
} 
 
struct dnsconfig_server { 
	sa_family_t family; 
	size_t addrsize; 
	union dnsconfig_server_union addr; 
}
RETURN VALUES
On success 0 is returned. On error -1 is returned, and errno is set appropriately.ERRORS
getdnsconfig() and setdnsconfig() will fail if:- EFAULT
 - cfg points to an invalid address.
 
- EAFNOSUPPORT
 - family is set to an address family other than AF_INET or AF_INET6.
 - EINVAL
 - servers_count is larger than DNSCONFIG_MAX_SERVERS.
 - EINVAL
 - addrsize does not match the size of the address corresponding to family.