netdir_sperror()--Indicate an Error in an NTA Routine


  Syntax

 #include <netdir.h>

 void  netdir_sperror();

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

The netdir_sperror() function issues an informational message that states why one of the name-to-address translation APIs may have failed.


Parameters

None.


Authorities

No authorization is required.


Return Value

None

netdir_sperror() issues an informational message that indicates the error in one of the name-to-address translation APIs.


Error Messages

Message ID Error Message Text
CPIA1B7 The previous name-to-address translation has completed.


Usage Notes

The netdir_sperror() function issues CPIA1B7 message that indicates why one of the name-to-address translation mapping APIs failed. This function should be used after a failed call to a name-to-address translation function prior to calling another name-to-address translation function.


Example

See Code disclaimer information for information pertaining to code examples.

The following example shows how netdir_sperror() is used:

#include <netdir.h>
#include <rpc/rpc_com.h>

main()
{
  void *handlep;
  struct netconfig *nconf;

  /* Initialize the network selection mechanism */
  if (handlep = setnetconfig()) == (void *)NULL)
  {
     exit(1);
  }

  /* Get a netconfig structure from the netconfig file */
  if ((nconf = getnetconfig(handlep)) == (struct netconf *)NULL)
  {
     printf("Unable to obtain a netconfig structure\n");
  }

  /* Set the protocol specific negotiation for broadcast */
  if (netdir_options(nconf, ND_SET_BROADCAST, RPC_ANYSOCK, NULL))
  {
     printf("Error setting the broadcasting option\n");
     printf("See the job log for error message\n");
     netdir_sperror();
  }

  /* Release the netconfig handle allocated by setnetconfig() */
  endnetconfig(handlep);
}



API introduced: V4R2
Top | Remote Procedure Call (RPC) APIs | APIs by category