setdomainname()--Set Domain Name


Syntax
#include <sys/types.h>
#include <sys/socket.h>

int setdomainname(char *name,
                  int length)


Threadsafe: Yes

The setdomainname() function is used to set the name of the domain.

Parameters

name
(Input) The pointer to a character array where the domain name is stored.

length
(Input) The length of the name parameter. The length can be from 0 to 255 bytes.

Return Value

setdomainname() returns an integer. Possible values are:

Error Conditions

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.

Error Messages

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.

Usage Notes

  1. A process must have the *IOSYSCFG special authority to use setdomainname().

  2. The name of the domain is set to NULL when the pointer to the domain name (pointed to by the name parameter) is set to NULL.

  3. setdomainname() only allows domain names that are made up of invariant characters. In addition, the domain name is assumed to be in the default coded character set identifier (CCSID) currently in effect for the job.

    Note: For exceptions to the invariant character set for some CCSIDs, see National Language Support.

Related Information


Top | Sockets APIs | APIs by category


[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]