#include <sys/types.h> #include <sys/socket.h> int getdomainname(char *name, int length)
The getdomainname() function is used to retrieve the name of the domain from the system.
None.
getdomainname() returns an integer. Possible values are:
When getdomainname() fails, errno can be set to one of the following:
[EFAULT] | Bad address.
The system detected an address which was not valid while attempting to access the name parameter. |
[EINVAL] | Parameter not valid.
The length parameter specifies a negative value. |
[EIO] | Input/output error. |
[EUNKNOWN] | Unknown system state. |
Message ID | Error Message Text |
---|---|
CPE3418 E | Possible APAR condition or hardware failure. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
CPFA081 E | Unable to set return value or error code. |
Note: The domain name returned by this function is NOT related to the domain name of the domain name server that is configured using the Configure TCP/IP (CFGTCP) menu.
Top | UNIX-Type APIs | APIs by category |