]> granicus.if.org Git - strace/blobdiff - ipc_shmctl.c
nlattr: add unsigned int decoders that print in hex form
[strace] / ipc_shmctl.c
index 7ea3672927a1f39ad2c253c7c6f0a4735b1cfeb0..18b92b3a6d6e9660349bc096b87b0331a133347b 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
  * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
  * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015-2017 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -51,7 +52,7 @@ typedef struct shmid64_ds shmid_ds_t;
 #include "xlat/shmctl_flags.h"
 
 static void
-print_shmid_ds(struct tcb *tcp, const long addr, int cmd)
+print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
 {
        /* TODO: We don't properly decode old compat ipc calls. */
        if (cmd & IPC_64)
@@ -97,11 +98,11 @@ print_shmid_ds(struct tcb *tcp, const long addr, int cmd)
 SYS_FUNC(shmctl)
 {
        if (entering(tcp)) {
-               tprintf("%lu, ", tcp->u_arg[0]);
+               tprintf("%d, ", (int) tcp->u_arg[0]);
                PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???");
                tprints(", ");
        } else {
-               const long addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2];
+               const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2];
                print_shmid_ds(tcp, addr, tcp->u_arg[1]);
        }
        return 0;