How to know whether the message queue is empty or not.



How to know whether the message queue is empty or not...

Answer / pavan

type the command: ipcs -m

you'll get no of messages in Message Q,

else
you can also use msqid_ds structure

i'e : define a structure variable of type
-> struct msqid_ds YOUR_VAR;
and access YOUR_VAR -> msg_qnum
it'll give no of messgaes on Q.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix IPC Interview Questions

Explain what are the system calls used for process management?

0 Answers  


Explain the initial process sequence while the system boots up?

0 Answers  


How to write the program on full-duplex communication on biderctional(e.g using two pipes)

2 Answers   Infosys,


What is ln(linking)?

0 Answers  


What are two different models of ipc differentiate both?

0 Answers  






How to write the program on full-duplex communication using 2 FIFOs

0 Answers  


What are various IDs associated with a process?

3 Answers  


What is Inode.

2 Answers   HCL,


How to write the program on full-duplex communication on bidirectional?

0 Answers  


Predict the output of the following program code main() { fork(); printf("Hello World!"); }

3 Answers  


what is the process id for kernel process?

8 Answers   IBM, ITI, Military Engineer Services, Remo, TATA,


Explain linking across directories?

0 Answers  


Categories