Qp0zDltSysEnv()--Delete a System-Level Environment Variable



Syntax

#include <qp0z1170.h>

int Qp0zDltSysEnv(const char *name, void *reserved);


Threadsafe: Yes

The Qp0zDltSysEnv() function deletes a single system-level environment variable or deletes all system-level environment variables. If the name parameter is NULL, all system-level environment variables are deleted.

The name parameter does not include the equal (=) symbol or the value part of the environment variable name=value pair.

Parameters

name
(Input) The name of the environment variable to delete.

reserved
(Input) Reserved for future use. Currently, the only value allowed is NULL.

Authorities

*JOBCTL special authority is required to delete a system-level environment variable.

Return Value

0
Qp0zDltSysEnv() was successful.
errval
Qp0zDltSysEnv() was not successful. errval is set to indicate the error.

Error Conditions

If Qp0zDltSysEnv() is not successful, errval indicates one of the following errors.

[EFAULT]
The address used for an argument is not correct.

In attempting to use an argument in a call, the system detected an address that is not valid.

While attempting to access a parameter passed to this function, the system detected an address that is not valid.

[ERROR_INVALID_PARAMETER]
An invalid parameter was found.

A parameter passed to this function is not valid.

The value for the reserved parameter was not NULL.

[ENOENT]
No such path or directory.

The directory or a component of the path name specified does not exist.

A named file or directory does not exist or is an empty string.

The parameter name is not NULL and does not point to an environment variable name that currently exists in the environment list.

[EPERM]
Operation not permitted.

You must have appropriate privileges or be the owner of the object or other resource to do the requested operation.

You must have *JOBCTL special authority to delete a system-level environment variable.

[EUNKNOWN]
Unknown system state.

The operation failed because of an unknown system state. See any messages in the job log and correct any errors that are indicated, then retry the operation.

Related Information

Example

See the example of using Qp0zDltSysEnv() in Qp0zPutSysEnv()--Change or Add a System-Level Environment.


Top | Environment Variable APIs | APIs by category


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