#include <netconfig.h> void *setnetconfig(void);
The setnetconfig() function initializes the record pointer to the first entry in the netconfig file. The setnetconfig() function must be used before the first use of getnetconfig() function. The setnetconfig() function returns a unique handle (a pointer to the records stored in the netconfig file) to be used by the getnetconfig() function.
None.
The caller of setnetconfig() function must have execute (*X) authority to the /etc directory and must have read (*R) authority to the netconfig file.
void pointer | setnetconfig() was successful. A void pointer to the records stored in the netconfig file is returned. |
NULL | setnetconfig() was not successful. The errno global variable is set to indicate the error. |
If setnetconfig() is not successful, errno usually indicates one of the following errors. Under some conditions, errno could indicate an error other than those listed here.
[EACCES] | Permission denied.
|
[EAGAIN] | Operation would have caused the process to be suspended. |
[EBADNAME] | The object name specified is not correct. |
[EBUSY] | Resource busy. |
[ECONVERT] | Conversion error.
|
[EDAMAGE] | A damaged object was encountered.
|
[EIO] | Input/output error.
|
[EMFILE] | Too many open files for this process.
|
[ENFILE] | Too many open files in the system.
|
[ENOENT] | No such path or directory.
|
[ENOMEM] | Storage allocation request failed.
|
[ENOSPC] | No space available.
|
[ENOSYSRSC] | System resources not available to complete the request. |
[EPERM] | Operation not permitted.
|
[EUNKNOWN] | Unknown system state.
|
Message ID | Error Message Text |
---|---|
CPE3418 E | Possible APAR condition or hardware failure. |
CPFA0D4 E | File system error occurred. |
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
CPIA1C0 I | The file /etc/netconfig cannot be opened by readers because another job has it open with write authority. |
The setnetconfig() function is used prior to using the getnetconfig() function to initialize the record pointer to the data stored in the netconfig file.
The setnetconfig() function will fail with [ENOENT] if the /etc/netconfig file does not exist. The setnetconfig() function will fail with [ECONVERT] if the data conversion required to convert the data stored in the /etc/netconfig file cannot be converted to the job CCSID.
For more information, see the example for endnetconfig()--Release the Pointer in the Netconfig File.
Top | Remote Procedure Call (RPC) APIs | APIs by category |