res_nmkupdate()--Construct an Update Packet


  Syntax
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>

 int res_nmkupdate(state* res,
              ns_updrec *update_record,  
              unsigned char *buffer,
              int buffer_length)


  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

The res_nmkupdate() function builds a dynamic update packet from the linked list of update records.


Parameters

res
(Input) The pointer to the state structure.

update_record
(Input) The pointer to the linked list of update records. See res_nupdate() for more information.

buffer
(Input) The pointer to the buffer to be filled in with the update packet.

buffer_length
(Input) The length of the buffer.

Authorities

No authorization is required.


Return Value

res_nmkupdate() returns an integer. Possible values are:


Error Conditions

When the res_nmkupdate() function fails, res_nmkupdate() can set errno to one of the following:

[ECONVERT]

Either the input packet could not be translated to ASCII or the answer received could not be translated to the coded character set identifier (CCSID) currently in effect for the job.

[EFAULT]

The system detected a pointer that was invalid while attempting to access an input pointer.

[EINVAL]

One of the following reasons:

Note: No attempt is made to initialize the res structure if it was initialized previous to the res_nmkupdate() being issued.

[EMSGSIZE]

The message buffer was too small. The return value was -2.


Usage Notes

  1. res_nmkupdate() calls res_ninit() if the res structure has not been initialized.

  2. res_nmkupdate() assumes that the data passed to it is EBCDIC and is in the default coded character set identifier (CCSID) currently in effect for the job. It translates the data from the default CCSID currently in effect for the job to ASCII (CCSID 819) before the data is sent out to a name server. The response that it receives from the name server is returned in the default CCSID currently in effect for the job.

Related Information



API introduced: V5R1

[ Back to top | UNIX-Type APIs | APIs by category ]