]> granicus.if.org Git - strace/blobdiff - stream.c
Change last parameter of umoven() from char* to void*
[strace] / stream.c
index 8c908382ccca4d4cd2821213a7ca06cd57d45c76..3ebbfb731755bbca79351360ef1a17491fbfdb4e 100644 (file)
--- a/stream.c
+++ b/stream.c
  */
 
 #include "defs.h"
-#ifdef HAVE_POLL_H
+#if defined HAVE_POLL_H
 # include <poll.h>
-#endif
-#ifdef HAVE_SYS_POLL_H
+#elif defined HAVE_SYS_POLL_H
 # include <sys/poll.h>
 #endif
 #ifdef HAVE_SYS_CONF_H
@@ -56,10 +55,7 @@ struct strbuf {
 #  define MOREDATA 2
 # endif
 
-static const struct xlat msgflags[] = {
-       { RS_HIPRI,     "RS_HIPRI"      },
-       { 0,            NULL            },
-};
+#include "xlat/msgflags.h"
 
 static void
 printstrbuf(struct tcb *tcp, struct strbuf *sbp, int getting)
@@ -154,18 +150,7 @@ sys_getmsg(struct tcb *tcp)
 }
 
 # if defined SYS_putpmsg || defined SYS_getpmsg
-static const struct xlat pmsgflags[] = {
-#  ifdef MSG_HIPRI
-       { MSG_HIPRI,    "MSG_HIPRI"     },
-#  endif
-#  ifdef MSG_AND
-       { MSG_ANY,      "MSG_ANY"       },
-#  endif
-#  ifdef MSG_BAND
-       { MSG_BAND,     "MSG_BAND"      },
-#  endif
-       { 0,            NULL            },
-};
+#include "xlat/pmsgflags.h"
 #  ifdef SYS_putpmsg
 int
 sys_putpmsg(struct tcb *tcp)
@@ -205,7 +190,7 @@ sys_getpmsg(struct tcb *tcp)
                for (i = 1; i < 3; i++)
                        printstrbufarg(tcp, tcp->u_arg[i], 1);
                /* pointer to band */
-               printnum(tcp, tcp->u_arg[3], "%d");
+               printnum_int(tcp, tcp->u_arg[3], "%d");
                tprints(", ");
                /* pointer to flags */
                if (tcp->u_arg[4] == 0)
@@ -243,29 +228,7 @@ sys_getpmsg(struct tcb *tcp)
 
 #ifdef HAVE_SYS_POLL_H
 
-static const struct xlat pollflags[] = {
-# ifdef POLLIN
-       { POLLIN,       "POLLIN"        },
-       { POLLPRI,      "POLLPRI"       },
-       { POLLOUT,      "POLLOUT"       },
-#  ifdef POLLRDNORM
-       { POLLRDNORM,   "POLLRDNORM"    },
-#  endif
-#  ifdef POLLWRNORM
-       { POLLWRNORM,   "POLLWRNORM"    },
-#  endif
-#  ifdef POLLRDBAND
-       { POLLRDBAND,   "POLLRDBAND"    },
-#  endif
-#  ifdef POLLWRBAND
-       { POLLWRBAND,   "POLLWRBAND"    },
-#  endif
-       { POLLERR,      "POLLERR"       },
-       { POLLHUP,      "POLLHUP"       },
-       { POLLNVAL,     "POLLNVAL"      },
-# endif
-       { 0,            NULL            },
-};
+#include "xlat/pollflags.h"
 
 static int
 decode_poll(struct tcb *tcp, long pts)
@@ -300,7 +263,7 @@ decode_poll(struct tcb *tcp, long pts)
                                tprints("...");
                                break;
                        }
-                       if (umoven(tcp, cur, sizeof fds, (char *) &fds) < 0) {
+                       if (umoven(tcp, cur, sizeof fds, &fds) < 0) {
                                tprints("?");
                                failed = 1;
                                break;
@@ -350,7 +313,7 @@ decode_poll(struct tcb *tcp, long pts)
                outptr = outstr;
 
                for (cur = start; cur < end; cur += sizeof(fds)) {
-                       if (umoven(tcp, cur, sizeof fds, (char *) &fds) < 0) {
+                       if (umoven(tcp, cur, sizeof fds, &fds) < 0) {
                                if (outptr < end_outstr - 2)
                                        *outptr++ = '?';
                                failed = 1;
@@ -422,7 +385,8 @@ sys_ppoll(struct tcb *tcp)
        if (entering(tcp)) {
                print_timespec(tcp, tcp->u_arg[2]);
                tprints(", ");
-               print_sigset(tcp, tcp->u_arg[3], 0);
+               /* NB: kernel requires arg[4] == NSIG / 8 */
+               print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]);
                tprintf(", %lu", tcp->u_arg[4]);
        }
        return rc;