SVR5 and SCO OpenServer 5
copyreq(D4str)
copyreq --
STREAMS transparent ioctl copy request structure
Synopsis
#include <sys/stream.h>
#include <sys/ddi.h>
Description
The copyreq structure contains
the information necessary to process
transparent ioctls.
Usage
The copyreq structure is used with
M_COPYIN(D7str)
and
M_COPYOUT(D7str)
message types.
The module or driver usually converts an
M_IOCTL(D7str)
or
M_IOCDATA(D7str)
message into an M_COPYIN or M_COPYOUT message.
The copyreq structure
is thus overlaid on top of the
iocblk(D4str)
or
copyresp(D4str)
structure.
The stream head guarantees that the message is large enough
to contain the different structures.
DDI structure definition
The DDI copyreq structure
contains the following members:
int cq_cmd;
cred_t *cq_cr;
uint_t cq_id;
caddr_t cq_addr;
uint_t cq_size;
int cq_flag;
mblk_t *cq_private;
ODDI structure definition
The ODDI copyreq structure
contains the following members:
int cq_cmd;
ushort cq_uid;
ushort cq_gid;
uint cq_id;
caddr_t cq_addr;
uint cq_size;
int cq_flag;
mblk_t *cq_private;
};
Structure members
cq_cmd
-
the ioctl command,
copied from the
ioc_cmd
member
of the
iocblk(D4str)
structure.
If the same message is used,
then the cq_cmd
member directly overlays
the ioc_cmd
member
so does not need to be copied.
cq_cr
-
contains a pointer to the user credentials.
It is copied from the
ioc_cr
member of the
iocblk(D4str)
structure.
If the same message is used,
then the cq_cr
member directly overlays
the ioc_cr
member
and so does not need to be copied.
(DDI only).
cq_uid
-
effective UID
(DDI only).
cq_gid
-
effective GID
(DDI only).
cq_id
-
ioctl ID,
copied from the
ioc_id
member of the
iocblk(D4str)
structure.
It is used to uniquely identify
the ioctl request in the stream.
If the same message is used,
then the cq_id
member
directly overlays the ioc_id
member,
so does not need to be copied.
For an
M_COPYIN(D7str)
message, the cq_addr
member contains
the user address from which the data are to be copied.
For an
M_COPYOUT(D7str)
message, the cq_addr
member
contains the user address to which the data are to be copied.
In both cases, the cq_size
member
contains the number of bytes to copy.
cq_addr
-
contains the user space address
from which the data is to be copied (M_COPYIN)
or to which the data is to be copied (M_COPYOUT).
cq_size
-
number of bytes to copy.
cq_flag
-
controls the use
of the canonical format specifier.
Valid values are:
STRCANON-
indicates that the
b_cont
data block
contains the canonical format specifier,
RECOPY-
causes the
M_COPYIN operation to be repeated,
this time using the canonical format specifier.
For
ODDI
drivers,
this member is reserved for future use.
The module or driver should set this member to 0.
cq_private
-
member is set aside for use by the driver.
It can be used to hold any state information
that is necessary to process the ioctl.
It is copied to the
cp_private
member
in the resultant
M_IOCDATA(D7str)
message.
When the M_COPYIN or M_COPYOUT message is freed,
any message that cq_private
references
is not freed by the STREAMS subsystem.
It is the responsibility of the module or driver to free it.
Hardware applicability
All
Version applicability
ddi:
1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 8, 8mp
oddi:
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp
References
copyresp(D4str),
datab(D4str),
iocblk(D4str),
Intro(D7str),
msgb(D4str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005