Results 1 to 1 of 1
Hello,
I try to use POSIX Message Queue API and in the doc it says that:
Code:
#include <mqueue.h>
int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
unsigned msg_prio);
#include ...
- 01-12-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 13
POSIX Message Queue
Hello,
I try to use POSIX Message Queue API and in the doc it says that:
The mq_send() function shall add the message pointed to by the argument msg_ptr to the message queue specified by mqdes. The msg_len argument specifies the length of the message, in bytes, pointed to by msg_ptr. The value of msg_len shall be less than or equal to the mq_msgsize attribute of the message queue, or mq_send() shall fail.Code:#include <mqueue.h> int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio); #include <mqueue.h> int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio);
As seen in the prototype of the function mq_send, the message element is represented by const char *msg_ptr. But what will it be if I need to send a message which is not a const char*, for example a structure object?
I wish if I explained my problem clearly. If not, I can try to explain more.
Thanks in advance.


Reply With Quote