]> granicus.if.org Git - strace/blobdiff - print_mq_attr.c
Fix decoding and dumping of readv syscall in case of short read
[strace] / print_mq_attr.c
index f9bff3429bdc56873cb0c979d68c557c17a2749d..a43d4376815e7b23c83cfbfada978e7c604df233 100644 (file)
 #include "defs.h"
 
 #include DEF_MPERS_TYPE(mq_attr_t)
+
 #ifdef HAVE_MQUEUE_H
 # include <mqueue.h>
 typedef struct mq_attr mq_attr_t;
+#elif defined HAVE_LINUX_MQUEUE_H
+# include <linux/types.h>
+# include <linux/mqueue.h>
+typedef struct mq_attr mq_attr_t;
 #endif
+
 #include MPERS_DEFS
 
 MPERS_PRINTER_DECL(void, printmqattr)(struct tcb *tcp, const long addr)
 {
-# ifndef HAVE_MQUEUE_H
-       printaddr(addr);
-# else
+#if defined HAVE_MQUEUE_H || defined HAVE_LINUX_MQUEUE_H
        mq_attr_t attr;
        if (umove_or_printaddr(tcp, addr, &attr))
                return;
@@ -48,5 +52,7 @@ MPERS_PRINTER_DECL(void, printmqattr)(struct tcb *tcp, const long addr)
        tprintf(", mq_maxmsg=%ld, mq_msgsize=%ld, mq_curmsg=%ld}",
                (long) attr.mq_maxmsg, (long) attr.mq_msgsize,
                (long) attr.mq_curmsgs);
-# endif
+#else
+       printaddr(addr);
+#endif
 }