I am working with queues with 2 diferent files on linux based system.
I am sending a struct by mq_send()
and receiving with mq_receive()
in another file.
When I used a char *
that worked perfectly, but now, I put my struct, I convert it with (char *)
and the sent happen, but I dont receive what I have to, and the number of bytes received in receive is always bytes received: 18446744073709551615
my struct is like:
struct men
{
int a;
int b;
};
I also put the sizeof of the struct in mq_send()
and mq_receive()
and also in the attributes of the queue in .mq_msgsize
.
I tried hard to find what is the problem, changing the sizes and whatever and I couldnt find the error.
Thank you!