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

Please explain fork() system call?

0 Answers  


What are various IDs associated with a process?

3 Answers  


Describe the initial process sequence while the system boots up?

4 Answers  


Explain what is the process id for kernel process?

0 Answers  


About i-node numbers

1 Answers  


How can you get or set an environment variable from a program?

2 Answers  


Explain about daemon?

0 Answers  


What is IPC? What are the various schemes available?

5 Answers  


How do you execute one program from within another?

4 Answers  


About ln(linking)

1 Answers   Infosys,


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

0 Answers  


What is ipc in unix?

0 Answers  


Categories