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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the various schemes available?

541


Please explain fork() system call?

553


What is fork()?

594


What is ln(linking)?

578


How to get or set an environment variable from a program?

538






Please describe the initial process sequence while the system boots up?

571


Explain the advantage of executing a process in background?

505


Explain what is the process id for kernel process?

574


What is unix ipc?

549


Explain a zombie?

617


What is the full form of ipc?

578


What are the various schemes available in ipc?

549


What is daemon?

526


Which ipc is the fastest in unix?

543


Explain about daemon?

562