setnetconfig()--Initialize the Pointer in the Netconfig File


  Syntax

 #include <netconfig.h>

 void *setnetconfig(void);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

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.


Parameters

None.


Authorities

The caller of setnetconfig() function must have execute (*X) authority to the /etc directory and must have read (*R) authority to the netconfig file.


Return Value



Error Conditions

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.


Error Messages



Usage Notes

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.


Example

For more information, see the example for endnetconfig()--Release the Pointer in the Netconfig File.



API introduced: V4R2

[ Back to top | Remote Procedure Call (RPC) APIs | APIs by category ]