Unix Programming - printing message queue info

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2004 > printing message queue info





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author printing message queue info
El Durango

2004-03-20, 10:37 am

Hi quick question.
I was wondering if it is possible to print the info (data...etc) of all the
messages created in the message queue.
If we obtained the msqid_ds using msgctl something like this:
struct msg *currentmsg;
currentmsg = msqid_info->msg_first;
while(currentmsg != msqid_info->msg_last){
/* print info */
currentmsg++;
}

however I am confused on how to obtain the message data from the msg struct
that is defined in sys/msg.h:

struct msg {
struct msg *msg_next; /* next message on queue */
long msg_type;
char *msg_spot; /* message text address */
time_t msg_stime; /* msgsnd time */
short msg_ts; /* message text size */
};

Or am I going in the wrong direction (I believe I am :\ )



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com