Hello everybody
I am writing a mini program in Linux
I have a message queue which has a default maximum capacity of
bytes that can be written in it.
I am trying to modify this capacity. I googled for a solution and tried
to change the value of (msg_qbytes) by writing these instructions :
key_t key;
key =111;
int msgflg = IPC_CREAT | 0666;
int msqid;
struct msqid_ds msqid_ds,*BUF;
BUF = &msqid_ds;
msqid = msgget(key,msgflg);
int result;
result= msgctl(msqid,IPC_SET,BUF);
BUF->msg_qbytes = 50;
After that I wrote some instruction to test the ability of
queue of recieving messages ,but I found that the message queue still recieving
amount of messages more than 50 bytes which shows that the capacity af the
message queue haven't changed.
Would you plz guide me to a solution for this problem?