NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
#include <unistd.h>int getdomainname(char * name, int namelen);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
POSIX_SOCKETS
getdomainname() returns the standard domain name for the current host, as previously set by setdomainname() . The parameter namelen specifies the size of the name array. The returned name is null-terminated unless insufficient space is provided.
setdomainname() sets the domain name of the host system to be name , which has length namelen . This call is restricted to the superuser and is normally used only when the system is bootstrapped.
If the call succeeds a value of 0 is returned. If the call fails, a value of - 1 is returned and an error code is placed in the global location errno .
The following errors may be returned by these calls:
The name or namelen parameter gave an invalid address.
The caller tried to set the hostname and was not the superuser.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
MT-level | MT-safe |
NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO