]> granicus.if.org Git - strace/blobdiff - sysctl.c
x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls
[strace] / sysctl.c
index 12763ac4b0bee09f5f4434cbe101cf261e980454..38436931c7ce944fbd73158ede1d3812a269f4b5 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -167,13 +167,13 @@ SYS_FUNC(sysctl)
                size_t oldlen = 0;
                if (info.oldval == NULL) {
                        tprints("NULL");
-               } else if (umove(tcp, (kernel_ureg_t) info.oldlenp, &oldlen) >= 0
+               } else if (umove(tcp, ptr_to_kulong(info.oldlenp), &oldlen) >= 0
                           && info.nlen >= 2
                           && ((name[0] == CTL_KERN
                                && (name[1] == KERN_OSRELEASE
                                    || name[1] == KERN_OSTYPE
                                        )))) {
-                       printpath(tcp, (size_t)info.oldval);
+                       printpath(tcp, ptr_to_kulong(info.oldval));
                } else {
                        tprintf("%p", info.oldval);
                }
@@ -183,7 +183,7 @@ SYS_FUNC(sysctl)
                else if (syserror(tcp))
                        tprintf("%p", info.newval);
                else
-                       printpath(tcp, (size_t)info.newval);
+                       printpath(tcp, ptr_to_kulong(info.newval));
                tprintf(", %lu", (unsigned long)info.newlen);
        }