]> granicus.if.org Git - strace/blobdiff - ipc_msg.c
Introduce struct_rt_sigframe type
[strace] / ipc_msg.c
index daa0036529b125d746444b08f8c804fbbd459724..a5f9e83e371789e6043728242bb62e15cb74f82c 100644 (file)
--- a/ipc_msg.c
+++ b/ipc_msg.c
 
 SYS_FUNC(msgget)
 {
-       if (tcp->u_arg[0])
-               tprintf("%#lx, ", tcp->u_arg[0]);
+       const int key = (int) tcp->u_arg[0];
+       if (key)
+               tprintf("%#x", key);
        else
-               tprints("IPC_PRIVATE, ");
+               tprints("IPC_PRIVATE");
+       tprints(", ");
        if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0)
                tprints("|");
-       tprintf("%#lo", tcp->u_arg[1] & 0777);
+       print_numeric_umode_t(tcp->u_arg[1] & 0777);
        return RVAL_DECODED;
 }
 
 static void
-tprint_msgsnd(struct tcb *tcp, const long addr, const unsigned long count,
-             const unsigned long flags)
+tprint_msgsnd(struct tcb *const tcp, const kernel_ulong_t addr,
+             const kernel_ulong_t count, const unsigned int flags)
 {
        tprint_msgbuf(tcp, addr, count);
        printflags(ipc_msg_flags, flags, "MSG_???");
@@ -76,15 +78,16 @@ SYS_FUNC(msgsnd)
 }
 
 static void
-tprint_msgrcv(struct tcb *tcp, const long addr, const unsigned long count,
-             const long msgtyp)
+tprint_msgrcv(struct tcb *const tcp, const kernel_ulong_t addr,
+             const kernel_ulong_t count, const kernel_ulong_t msgtyp)
 {
        tprint_msgbuf(tcp, addr, count);
-       tprintf("%ld, ", msgtyp);
+       tprintf("%" PRI_kld ", ", msgtyp);
 }
 
 static int
-fetch_msgrcv_args(struct tcb *tcp, const long addr, unsigned long *pair)
+fetch_msgrcv_args(struct tcb *const tcp, const kernel_ulong_t addr,
+                 kernel_ulong_t *const pair)
 {
        if (current_wordsize == sizeof(*pair)) {
                if (umoven_or_printaddr(tcp, addr, 2 * sizeof(*pair), pair))
@@ -115,10 +118,10 @@ SYS_FUNC(msgrcv)
                                tprint_msgrcv(tcp, tcp->u_arg[3],
                                              tcp->u_arg[1], tcp->u_arg[4]);
                        } else {
-                               unsigned long pair[2];
+                               kernel_ulong_t pair[2];
 
                                if (fetch_msgrcv_args(tcp, tcp->u_arg[3], pair))
-                                       tprintf(", %lu, ", tcp->u_arg[1]);
+                                       tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
                                else
                                        tprint_msgrcv(tcp, pair[0],
                                                      tcp->u_arg[1], pair[1]);