]> granicus.if.org Git - strace/blobdiff - file_handle.c
x32: fix decoding of 3rd argument of preadv* and pwritev* syscalls
[strace] / file_handle.c
index 66801010457e28d241e6d157633e9659ccdbe1c4..009915a79748405e85d4dbf1ecfdd53ab4494397 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "defs.h"
 
+#include "xlat/name_to_handle_at_flags.h"
+
 #ifndef MAX_HANDLE_SZ
 # define MAX_HANDLE_SZ 128
 #endif
@@ -58,21 +60,18 @@ SYS_FUNC(name_to_handle_at)
                        tprints(", ");
 
                        /* flags */
-                       printflags(at_flags, tcp->u_arg[4], "AT_???");
+                       printflags(name_to_handle_at_flags, tcp->u_arg[4],
+                                  "AT_???");
 
                        return RVAL_DECODED;
                }
                tprintf("{handle_bytes=%u", h.handle_bytes);
 
-               /*
-                * Abusing tcp->auxstr as a temporary storage.
-                * Will be used and cleared on syscall exit.
-                */
-               tcp->auxstr = (void *) (unsigned long) h.handle_bytes;
+               set_tcb_priv_ulong(tcp, h.handle_bytes);
 
                return 0;
        } else {
-               unsigned int i = (unsigned long) tcp->auxstr;
+               unsigned int i = get_tcb_priv_ulong(tcp);
 
                if ((!syserror(tcp) || EOVERFLOW == tcp->u_error)
                    && !umove(tcp, addr, &h)) {
@@ -93,14 +92,13 @@ SYS_FUNC(name_to_handle_at)
                        }
                }
                tprints("}, ");
-               tcp->auxstr = NULL;
 
                /* mount_id */
                printnum_int(tcp, tcp->u_arg[3], "%d");
                tprints(", ");
 
                /* flags */
-               printflags(at_flags, tcp->u_arg[4], "AT_???");
+               printflags(name_to_handle_at_flags, tcp->u_arg[4], "AT_???");
        }
        return 0;
 }