copyresp(D4DK) —
NAME
copyresp − STREAMS transparent ioctl copy response structure
SYNOPSIS
#include <sys/stream.h>
DESCRIPTION
The copyresp structure contains information in response to a prior copy request necessary to continue processing transparent ioctls. M_IOCDATA messages, generated by the stream head, contain the copyresp structure.
STRUCTURE MEMBERS
| int | cp_cmd; | /∗ ioctl command ∗/ |
| cred_t | ∗cp_cr; | /∗ user credentials ∗/ |
| uint_t | cp_id; | /∗ ioctl ID ∗/ |
| caddr_t | cp_rval; | /∗ status of request ∗/ |
| mblk_t | ∗cp_private; | /∗ module private data ∗/ |
The cp_cmd field is the ioctl command, copied from the cq_cmd field of the copyreq structure.
The cp_cr field contains a pointer to the user credentials. It is copied from the cq_cr field of the copyreq structure.
The cp_id field is the ioctl ID, copied from the cq_id field of the copyreq structure. It is used to uniquely identify the ioctl request in the stream.
The cq_rval field contains the return value from the last copy request. If the request succeeded, it is set to 0. Otherwise, if it is non-zero, the request failed. On success, the module or driver should continue processing the ioctl. On failure, the module or driver should abort ioctl processing and free the message. No M_IOCNAK message need be generated.
The cp_private field is copied from the cq_private field of the copyreq structure. It is available so that the module or driver can regain enough state information to continue processing the ioctl request.
NOTES
If an M_IOCDATA message is reused, any unused fields in the new message should be cleared.
When the M_IOCDATA message is freed, any message that cp_private refers to is not freed by the STREAMS subsystem. It is the responsibility of the module or driver to free it.
SEE ALSO
Programmer’s Guide: STREAMS
datab(D4DK), msgb(D4DK), copyreq(D4DK), iocblk(D4DK), messages(D5DK)
DDI/DKI — STREAMS