Hi,

does anyone know how i can check how many messages are in the message queue, i tried IPC_STAT but it gives me a constant of 2.

any help would be appreciated!!

- 05-25-2004smeglychecking how many messages in msg queue using msgctl commands
Hi,

does anyone know how i can check how many messages are in the message queue, i tried IPC_STAT but it gives me a constant of 2.

any help would be appreciated!! - 05-25-2004HammerCode:
`struct msqid_ds ds;`

if (msgctl(msqid, IPC_STAT, &ds) == -1)

{

perror ("msgctl");

}

else

{

printf ("There are %d msgs on the q\n", ds.msg_qnum);

}

- 05-25-2004smegly
thanks mate