]> granicus.if.org Git - strace/blobdiff - print_msgbuf.c
Update NEWS
[strace] / print_msgbuf.c
index ac3dab09a8088467845e393a1c4ce3e0b3c3ecef..68d8741be045d5828dce7e9c14e30ea9f50d988a 100644 (file)
 
 #include "defs.h"
 
-void
-tprint_msgbuf(struct tcb *tcp, const long addr, const unsigned long count)
+#include <sys/msg.h>
+
+#include DEF_MPERS_TYPE(msgbuf_t)
+typedef struct msgbuf msgbuf_t;
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(void, tprint_msgbuf,
+                  struct tcb *tcp, const long addr, const unsigned long count)
 {
-       long mtype;
+       msgbuf_t msg;
 
-       if (!umove_or_printaddr(tcp, addr, &mtype)) {
-               tprintf("{%lu, ", mtype);
-               printstr(tcp, addr + sizeof(mtype), count);
+       if (!umove_or_printaddr(tcp, addr, &msg)) {
+               tprintf("{%lu, ", (long) msg.mtype);
+               printstr(tcp, addr + sizeof(msg.mtype), count);
                tprints("}");
        }
        tprintf(", %lu, ", count);