]> granicus.if.org Git - strace/blobdiff - poll.c
netlink: add a basic rtnetlink parser of nsid messages
[strace] / poll.c
diff --git a/poll.c b/poll.c
index ae3fd1fde1209a32481cff21821915e93d0322d9..e3b497caa1dcfec4cc62780dbe2f4ee803d28134 100644 (file)
--- a/poll.c
+++ b/poll.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
  * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2017 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,7 +51,7 @@ print_pollfd(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 static void
 decode_poll_entering(struct tcb *tcp)
 {
-       const kernel_ureg_t addr = tcp->u_arg[0];
+       const kernel_ulong_t addr = tcp->u_arg[0];
        const unsigned int nfds = tcp->u_arg[1];
        struct pollfd fds;
 
@@ -60,17 +61,17 @@ decode_poll_entering(struct tcb *tcp)
 }
 
 static int
-decode_poll_exiting(struct tcb *tcp, const long pts)
+decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts)
 {
        struct pollfd fds;
        const unsigned int nfds = tcp->u_arg[1];
        const unsigned long size = sizeof(fds) * nfds;
-       const kernel_ureg_t start = tcp->u_arg[0];
-       const kernel_ureg_t end = start + size;
-       kernel_ureg_t cur;
-       const unsigned long max_printed =
+       const kernel_ulong_t start = tcp->u_arg[0];
+       const kernel_ulong_t end = start + size;
+       kernel_ulong_t cur;
+       const unsigned int max_printed =
                abbrev(tcp) ? max_strlen : -1U;
-       unsigned long printed;
+       unsigned int printed;
 
        static char outstr[1024];
        char *outptr;
@@ -95,7 +96,7 @@ decode_poll_exiting(struct tcb *tcp, const long pts)
                                *outptr++ = '[';
                        else
                                outptr = stpcpy(outptr, ", ");
-                       outptr += sprintf(outptr, "%#lx", cur);
+                       outptr += sprintf(outptr, "%#" PRI_klx, cur);
                        break;
                }
                if (!fds.revents)
@@ -176,9 +177,9 @@ SYS_FUNC(ppoll)
 
                print_timespec(tcp, tcp->u_arg[2]);
                tprints(", ");
-               /* NB: kernel requires arg[4] == NSIG / 8 */
+               /* NB: kernel requires arg[4] == NSIG_BYTES */
                print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]);
-               tprintf(", %lu", tcp->u_arg[4]);
+               tprintf(", %" PRI_klu, tcp->u_arg[4]);
 
                return 0;
        } else {