#include <sys/types.h>
#include <sys/socket.h>
int setdomainname(char *name,
int length)
The setdomainname() function is used to set the name of the domain.
No authorization is required.
setdomainname() returns an integer. Possible values are:
When setdomainname() 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.
This error code indicates one of the following:
|
| [EIO] | Input/output error. |
| [EPERM] | Operation not permitted.
The process does not have the appropriate privileges to use setdomainname(). |
| [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: For exceptions to the invariant character set for some CCSIDs, see globalization topic.
| Top | UNIX-Type APIs | APIs by category |