I’m using memcpy() instead of resmgr_msgread() (or MsgRead())
in getting/setting data structures in my resmgr io_devctl()
(resmgr_io_funcs.devctl = io_devctl);
What is with safety in that situation ?
/memory errors, faults;
Can I use memcpy() instead of resmgr_msgread() ?
/do You have MsgRead() source code ?
is there any calls to memcpy() ?
I’m using memcpy() instead of resmgr_msgread() (or MsgRead())
in getting/setting data structures in my resmgr io_devctl()
(resmgr_io_funcs.devctl = io_devctl);
What is with safety in that situation ?
/memory errors, faults;
Can I use memcpy() instead of resmgr_msgread() ?
/do You have MsgRead() source code ?
is there any calls to memcpy() ?
MsgRead will make a kernel call to gather the unread portion of the message,
if it has not been already read. You cannot replace it with memcpy.
MsgRead will make a kernel call to gather the unread portion of the
message, if it has not been already read. You cannot replace it with
memcpy.
…so why it works ? >
Most probably because the default msg size that is ready by the resmgr
framework is enough to contain the whole message. If the message would be
bigger then the buffer size your code would break.
Most probably because the default msg size that is ready by the resmgr
framework is enough to contain the whole message.
…so I can use memcpy() instead of MsgRead()
if I set resmgr attributes (in resmgr_attach()) to that:
resmgr_attr.nparts_max = 1;
resmgr_attr.msg_max_size = 2048;
…and any received message is <= 2048 bytes length;
Most probably because the default msg size that is ready by the resmgr
framework is enough to contain the whole message.
…so I can use memcpy() instead of MsgRead()
if I set resmgr attributes (in resmgr_attach()) to that:
resmgr_attr.nparts_max = 1;
resmgr_attr.msg_max_size = 2048;
…and any received message is <= 2048 bytes length;
Most probably because the default msg size that is ready by the resmgr
framework is enough to contain the whole message.
…so I can use memcpy() instead of MsgRead()
if I set resmgr attributes (in resmgr_attach()) to that:
resmgr_attr.nparts_max = 1;
resmgr_attr.msg_max_size = 2048;
…and any received message is <= 2048 bytes length;
correct?
This assumption may broken if you receive a “combind message”
(multiple message in one shot).