Answers for "c send struct over message queue"

1

c send struct over message queue

typedef struct Req
{
  pid_t pid;
  char data[4096];
} Req;

Req buf;

n = mq_receive(mqdes0, (char *) &buf, sizeof(buf), NULL);

mq_send(mqdes1, (const char *) &buf, sizeof(buf), 0);
Posted by: Guest on July-03-2021

Browse Popular Code Answers by Language