| 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 :\ )
|